-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-command
executable file
·71 lines (70 loc) · 1.75 KB
/
run-command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
# [Gedit Tool]
# Comment=Execute a custom command and put its output in a new document
# Name=Ultimate
# Shortcut=F5
# Languages=
# Applicability=all
# Output=output-panel
# Input=nothing
# Save-files=document
ext=${GEDIT_CURRENT_DOCUMENT_NAME##*\.}
case $ext in
# ---------------------latex
tex)
if pdflatex ${GEDIT_CURRENT_DOCUMENT_NAME}
then
evince ${GEDIT_CURRENT_DOCUMENT_NAME%\.*}.pdf &
fi
;;
java)
#-------------------------java
if javac "$GEDIT_CURRENT_DOCUMENT_PATH"
then
if `zenity --question --text="Compilation Successful.\n Do you want to run class "${GEDIT_CURRENT_DOCUMENT_NAME%\.*}" ?\n "$" java ${GEDIT_CURRENT_DOCUMENT_NAME%\.*}"`
then
args=`zenity --entry --title="Any Arguments to give?" --text="System input shall be taken fraom a file system.in if exists. \n Enter the arguments here"`
cd $GEDIT_CURRENT_DOCUMENT_DIR
java ${GEDIT_CURRENT_DOCUMENT_NAME%\.*} $args < system.in
fi
fi
#java section ends---------------------------------c
;;
c)
gcc ${GEDIT_CURRENT_DOCUMENT_NAME} -o ${GEDIT_CURRENT_DOCUMENT_NAME%\.*}.out
;;
#cccc-----------------------------------php
php)
php $GEDIT_CURRENT_DOCUMENT_PATH > /dev/null
if [ $? -eq 0 ] ;
then
echo "Compiled Successfully"
else
echo $?
fi
;;
# php------------------------------ruby
rb)
echo "Ruby file not yet supported"
;;
# ruby ------------------------not yet supported
mll)
if(ocamllex ${GEDIT_CURRENT_DOCUMENT_NAME})
then echo "ocaml file generated"
fi
;;
ml)
if(ocamlc ${GEDIT_CURRENT_DOCUMENT_NAME})
then echo "ocaml file compiled"
${GEDIT_CURRENT_DOCUMENT_DIR}/a.out < sample.in
fi
;;
l)
if(flex ${GEDIT_CURRENT_DOCUMENT_NAME})
then echo "Flex code compiled to lex.yy.c"
fi
;;
*)
echo "The file format could not be determined."
;;
esac