-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_apps.sh
48 lines (32 loc) · 1.01 KB
/
create_apps.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
43
44
45
46
47
48
#/bin/bash/
temp_dir="${PWD}/temp/"
appimage_dir="${PWD}/myApps/"
if [ ! -d "$temp_dir" ]; then
mkdir -p "$temp_dir"
fi
if [ ! -d "$appimage_dir" ]; then
mkdir -p "$appimage_dir"
fi
while IFS= read -r line; do
appName=$(echo "$line" | cut -d ',' -f 1)
url=$(echo "$line" | cut -d ',' -f 2)
url_esc=$(echo "$url" | sed -e 's/\//\\\//g')
appNameLowercase=${appName,,}
echo; echo
echo "###### Creating ${appName}"
echo; echo
cp -r appMaster/ $temp_dir/$appNameLowercase/
cp -f myApplist/$appNameLowercase.png $temp_dir/$appNameLowercase/icon.png
cd $temp_dir/$appNameLowercase
sed -i "s/name__of__app__/${appName}/g" main.js
sed -i "s/https:\/\/example.com\//${url_esc}/g" main.js
sed -i "s/name__of__app__/${appName}/g" package.json
sed -i "s/name__of__app_lc__/${appNameLowercase}/g" package.json
npm install
npm run dist
cd dist
cp *.AppImage $appimage_dir
cd $temp_dir
cd ..
done < "myApplist/applist.txt"
rm -r $temp_dir