~cadence/bibliogram-updater

ref: 86226e79f9ccd9ec3996220c3c28e1d55b4f8ee6 bibliogram-updater/run.fish -rwxr-xr-x 764 bytes
86226e79 — Cadence Ember Update most GitHub links 6 months ago
                                                                                
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
#!/usr/bin/env fish

cd (dirname (status filename))

source utils/helpers.fish; or exit
source utils/constants.fish; or exit

if do_update
	echo 'Self-update successful.'
	exec ./run.fish
end

if not test -e state/is_installed
	exec ./install.fish
end

# ---

if test -e state/use_local_node
	set -a PATH $PWD/$node_folder/bin
end

set pull_interval 10m
set update_applied false

cd bibliogram/src/site

if do_update
	npm install --no-optional
end

while true
	set update_applied false

	echo '' | node server.js &
	set -l b_pid (jobs -p)

	while not $update_applied
		sleep $pull_interval

		if do_update
			npm install --no-optional
			set update_applied true
			kill $b_pid
		else
			echo '[ ] ['(date +%H%M%S)'] [UPD] No updates available yet.'
		end
	end
end