-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·42 lines (35 loc) · 801 Bytes
/
build.sh
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
#!/bin/bash
myexe="./processing-3.1.1/processing-java"
input_folder=${PWD##}
sketch_name=${PWD##*/}
output_folder=$input_folder"_output"
if [ ! -e $myexe ]
then
echo "Executable '"$myexe"' not found, line "$LINENO
exit 1
fi
if [ ! -e $input_folder ]
then
echo "Input folder '"$input_folder"' not found, line "$LINENO
exit 1
fi
if [ -e $output_folder ]
then
echo "Output folder '"$output_folder"' found, deleting it"
rm -rf $output_folder
fi
if [ -e $output_folder ]
then
echo "Folder '"$output_folder"' could not be deleted, line "$LINENO
exit 1
fi
$myexe --sketch=$input_folder --output=$output_folder --build > /dev/null
if [ -e $output_folder/$sketch_name.class ]
then
# echo "Success"
rm -rf $output_folder
exit 0
else
echo "Build failed, line "$LINENO
exit 1
fi