-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·43 lines (37 loc) · 1.4 KB
/
build
File metadata and controls
executable file
·43 lines (37 loc) · 1.4 KB
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
#!/usr/bin/env bash
if [ $# -le 3 ] && [ $# -ge 4 ]; then
echo "Usage: $0 <client_id> <client_secret> <input_file>"
exit 1
fi
if [ ! -f "$3" ]; then
echo "Error: The file '$3' does not exist."
exit 1
fi
source_file=$(realpath $3)
destination=$(realpath ../spotify_data)
# Download the data retriever
rm -rf spotify_data
curl -LO https://github.com/AlbumShuffler/DataRetriever/archive/refs/heads/master.zip
rm -rf DataRetriever-master
unzip master.zip
rm master.zip
cd DataRetriever-master
./refresh_all_data $1 $2 $source_file $destination
cd ..
rm -rf DataRetriever-master
# Download the latest version of the generator project, extract it and install its dependencies
curl -LO https://github.com/AlbumShuffler/Generator/archive/refs/heads/master.zip
rm -rf Generator-master
unzip master.zip
rm master.zip
cd Generator-master
npm i
export ALBUM_SHUFFLER_GENERATOR_SOURCE_URL=file://$source_file
export ALBUM_SHUFFLER_GENERATOR_ARTIST_DETAILS_URL=file://$destination/'${artistId}'/artist
export ALBUM_SHUFFLER_GENERATOR_ALBUMS_URL=file://$destination/'${artistId}'/albums
node index.js --destination=../src/
cd ..
rm -rf Generator-master
npx --yes elm make src/Main.elm --optimize --output main.js
npx --yes uglify-js main.js --compress 'pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe' | npx uglify-js --mangle --output dist/js/main.js
rm main.js