aboutsummaryrefslogtreecommitdiff
path: root/Makefile.toml
blob: fec5a683ec15d814e5cbb03510b8c8e914158f07 (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# -------------
# | Variables |
# -------------
[env]
# This variable will vary depending on where you installed Worlds, ideally, you
# should know the correct value for your own system.
#
# If you DON'T know the correct value, DO NOT file an issue on GitHub, ask
# someone within the Whirlsplash Discord server;
# https://discord.com/invite/8hn6padWF6.
#
# See line 49!
WORLDS_PATH = "C:\\Program Files (x86)\\Worlds Inc\\WorldsPlayer - Win7\\WorldsPlayer.exe"

# ------------
# | Wrappers |
# ------------
[tasks.fmt]
command = "cargo"
args = ["fmt"]
private = true

[tasks.check]
command = "cargo"
args = ["check"]
private = true

[tasks.clippy]
command = "cargo"
args = ["clippy"]
private = true

# -------------
# | Executors |
# -------------
[tasks.checkf]
dependencies = ["fmt", "check"]

[tasks.checkfc]
dependencies = ["fmt", "check", "clippy"]

[tasks.help]
dependencies = ["checkf"]
command = "cargo"
args = ["run", "--", "help"]

[tasks.run]
dependencies = ["checkf"]
command = "cargo"
args = ["run", "--", "run"]

# This task also depends on your system configuration, same goes as read above.
[tasks.start-client]
command = "gsudo"
args = ["${WORLDS_PATH}"]

[tasks.runc]
dependencies = ["start-client", "run"]

[tasks.runw]
env = { "DISABLE_PROMPT" = true }
dependencies = ["checkf"]
command = "cargo"
args = ["run", "--", "run"]
watch = true

[tasks.docker-build]
command = "nix-build"
args = ["docker.nix"]

[tasks.docker-load]
script_runner = "@shell"
script = '''
docker load < result
'''

[tasks.docker-run]
command = "docker"
args = [
  "run",
  "--name", "Whirlsplash",
  #     API                Distributor        Hub
  "-p", "8000:8000", "-p", "6650:6650", "-p", "5673:5673",
  "whirlsplash/whirl"
]

[tasks.docker-run-i]
command = "docker"
args = [
  "run",
  "-it",
  "--name", "Whirlsplash",
  #     API                Distributor        Hub
  "-p", "8000:8000", "-p", "6650:6650", "-p", "5673:5673",
  "--env", "DISABLE_PROMPT=false",
  "whirlsplash/whirl"
]

# Build 'n' load
[tasks.bnl]
dependencies = ["docker-build", "docker-load"]

[tasks.ask-discord-token]
script = '''
#!@duckscript

echo github token:
github_token = read

echo set ${github_token} as the current github token
set_env GITHUB_TOKEN ${github_token}
'''

[tasks.act]
dependencies = ["ask-discord-token"]
command = "act"
args = ["-s", "GITHUB_TOKEN=${GITHUB_TOKEN}"]