-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcwd-updater.rb
40 lines (40 loc) · 1.82 KB
/
cwd-updater.rb
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
#!/usr/bin/env ruby
system "rm ./version-check"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/version-check"
version = %x[cat ./version-check]
installed = %x[cat ./installed-version]
time = Time.new
$ltc = time.strftime("%Y-%m-%d-%H:%M:%S")
puts "installed : #{installed.to_s}"
puts "online : #{version.to_s}"
puts "would you like to update? (y/n)"
$update = gets.chomp
if $update == "y"
puts "updating..."
system "rm ./cryptowatchdash.rb"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/cryptowatchdash.rb"
system "rm ./old-version"
system "cp ./installed-version ./old-version"
system "rm ./installed-version"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/installed-version"
system "rm ./cwd-updater.rb"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/cwd-updater.rb"
system "chmod +x ./cwd-updater.rb"
system "chmod +x ./cryptowatchdash*"
system "mkdir ./backup"
system "mv ./*.csv ./#{$ltc}-logbackup.csv"
system "mv ./*.csv ./backup"
system "mv ./cryptodata.txt ./#{$ltc}-cryptodata.txt"
system "mv ./*-cryptodata.txt ./backup"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/cryptodata.txt"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/cryptodata.txt-logging.csv"
system "gedit ./cryptodata.txt ./backup/#{$ltc}-cryptodata.txt"
system "rm ./changelog.txt"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/changelog.txt"
system "rm ./after-effects.rb"
system "wget https://raw.githubusercontent.com/bigc0127/cryptowatchdash/main/after-effects.rb"
system "chmod +x ./after-effects.rb"
system "./after-effects.rb"
else
puts "exiting..."
end