Skip to content

Commit c2ec254

Browse files
committed
adding javascript support
1 parent 2c9e430 commit c2ec254

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

run

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ run() {
185185

186186
elif [[ ${FILE#*.} == sh ]]; then
187187
./"$FILE"
188+
189+
elif [[ ${FILE#*.} == js ]]; then
190+
if [[ $DEBUG == true ]]; then
191+
node debug "$FILE"
192+
else
193+
node "$FILE"
194+
fi
188195

189196
else
190197
_ERROR_UFTC_
@@ -206,16 +213,17 @@ for arg in "$@"; do
206213
"ll" | "--list-langs")
207214
echo
208215
echo " ${cyan}Languages supported by the currently installed version of ${red}code-runner${cyan}:"
209-
echo " ${yellow}>>${white} C ${cyan}[${white}with ${green}debug${white} support${cyan}]"
210-
echo " ${yellow}>>${white} C++ ${cyan}[${white}with ${green}debug${white} support${cyan}]"
216+
echo " ${yellow}>>${white} C ${cyan}[${white}with ${green}debug${white} support${cyan}]"
217+
echo " ${yellow}>>${white} C++ ${cyan}[${white}with ${green}debug${white} support${cyan}]"
211218
echo " ${yellow}>>${white} Python"
212219
echo " ${yellow}>>${white} Rust"
213220
echo " ${yellow}>>${white} Java"
214221
echo " ${yellow}>>${white} Bash-Script"
222+
echo " ${yellow}>>${white} Javascript ${cyan}[${white}with ${green}debug${white} support${cyan}]"
215223
echo
216224
;;
217225

218-
*".c" | *".cpp" | *".py" | *".rs" | *".java" | *".sh")
226+
*".c" | *".cpp" | *".py" | *".rs" | *".java" | *".sh" | *".js")
219227
FILE_LOCATION=$arg
220228
if [[ ! -f $FILE_LOCATION ]]; then
221229
_ERROR_UFTC_

0 commit comments

Comments
 (0)