-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupdate_metro84.rb
More file actions
56 lines (45 loc) · 1.83 KB
/
update_metro84.rb
File metadata and controls
56 lines (45 loc) · 1.83 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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env ruby
# --------------------------------------------------------------
# Metrocenter'84 Update 1.0
# Copyright (C) 2020 by Stefan Vogt.
# See file LICENSE for details.
# --------------------------------------------------------------
require 'open-uri'
require 'fileutils'
$is_windows = (ENV['OS'] == 'Windows_NT')
if $is_windows then
# path on Windows
$METROPATH = "C:\\YourProject\\MetroLib"
else
# path on Linux
$METROPATH = "/usr/share/retroinform/metro84"
end
$METRO_PARSER = File.join($METROPATH, 'parser.h')
$METRO_GRAMMAR = File.join($METROPATH, 'grammar.h')
$METRO_VERBLIB = File.join($METROPATH, 'verblib.h')
$EXT_SCENERY = File.join($METROPATH, 'scenery.h')
$EXT_FLAGS = File.join($METROPATH, 'flags.h')
puts "Metrocenter'84 Update 1.0"
puts "--------------------------------------"
puts "fetching parser.h"
File.open($METRO_PARSER, "w") do |file|
file.write OpenURI.open_uri('https://raw.githubusercontent.com//ByteProject/Metrocenter84/master/metro84/parser.h').read
end
puts "fetching grammar.h"
File.open($METRO_GRAMMAR, "w") do |file|
file.write OpenURI.open_uri('https://raw.githubusercontent.com//ByteProject/Metrocenter84/master/metro84/grammar.h').read
end
puts "fetching verblib.h"
File.open($METRO_VERBLIB, "w") do |file|
file.write OpenURI.open_uri('https://raw.githubusercontent.com//ByteProject/Metrocenter84/master/metro84/verblib.h').read
end
puts "fetching scenery.h"
File.open($EXT_SCENERY, "w") do |file|
file.write OpenURI.open_uri('https://raw.githubusercontent.com//ByteProject/Metrocenter84/master/metro84/scenery.h').read
end
puts "fetching flags.h"
File.open($EXT_FLAGS, "w") do |file|
file.write OpenURI.open_uri('https://raw.githubusercontent.com//ByteProject/Metrocenter84/master/metro84/flags.h').read
end
puts "--------------------------------------"
puts "All files were updated."