hackmud-script-manager 0.20.4-398440f → 0.20.4-459d480
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/bin/hsm.js +15 -6
- package/env.d.ts +709 -1293
- package/package.json +6 -2
- package/processScript/minify.js +11 -8
- package/processScript/transform.js +8 -6
- package/push.d.ts +9 -1
- package/push.js +33 -11
- package/syncMacros.js +1 -1
package/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Hackmud Script Manager
|
2
|
-
Command made for [
|
2
|
+
Command made for [Hackmud Scripting Environment](https://github.com/samualtnorman/hackmud-environment), which is a scripting environment for hackmud with minification, autocompletes / intellisense, and TypeScript support.
|
3
3
|
|
4
4
|
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R0XN5CX)
|
5
5
|
|
package/bin/hsm.js
CHANGED
@@ -12,7 +12,7 @@ import { pull } from "../pull.js"
|
|
12
12
|
import { syncMacros } from "../syncMacros.js"
|
13
13
|
import "@samual/lib/readDirectoryWithStats"
|
14
14
|
import "@samual/lib/copyFilePersistent"
|
15
|
-
const version = "0.20.4-
|
15
|
+
const version = "0.20.4-459d480",
|
16
16
|
options = new Map(),
|
17
17
|
commands = [],
|
18
18
|
userColours = new Cache(user => {
|
@@ -119,16 +119,25 @@ switch (commands[0]) {
|
|
119
119
|
logHelp()
|
120
120
|
break
|
121
121
|
}
|
122
|
-
const { push } = await pushModule
|
123
|
-
|
124
|
-
await push(sourcePath, hackmudPath, {
|
122
|
+
const { push, MissingSourceFolderError, MissingHackmudFolderError, NoUsersError } = await pushModule,
|
123
|
+
infos = await push(sourcePath, hackmudPath, {
|
125
124
|
scripts,
|
126
125
|
onPush: info => logInfo(info, hackmudPath),
|
127
126
|
minify: shouldMinify,
|
128
127
|
mangleNames: shouldMangleNames,
|
129
128
|
forceQuineCheats: shouldforceQuineCheats
|
130
129
|
})
|
131
|
-
|
130
|
+
if (infos instanceof Error) {
|
131
|
+
logError(infos.message)
|
132
|
+
if (infos instanceof MissingSourceFolderError || infos instanceof NoUsersError) {
|
133
|
+
console.log()
|
134
|
+
logHelp()
|
135
|
+
} else
|
136
|
+
infos instanceof MissingHackmudFolderError &&
|
137
|
+
log(
|
138
|
+
`If this is not where your hackmud folder is, you can specify it with the\n${colourN("--hackmud-path")}=${colourB("<path>")} option or ${colourN("HSM_HACKMUD_PATH")} environment variable`
|
139
|
+
)
|
140
|
+
} else infos.length || logError("Could not find any scripts to push")
|
132
141
|
}
|
133
142
|
break
|
134
143
|
case "dev":
|
@@ -245,7 +254,7 @@ switch (commands[0]) {
|
|
245
254
|
typeDeclaration = await generateTypeDeclaration(sourcePath, getHackmudPath())
|
246
255
|
let typeDeclarationPath = resolve(outputPath)
|
247
256
|
await writeFile(typeDeclarationPath, typeDeclaration).catch(error => {
|
248
|
-
assert(error instanceof Error, "src/bin/hsm.ts:
|
257
|
+
assert(error instanceof Error, "src/bin/hsm.ts:340:35")
|
249
258
|
if ("EISDIR" != error.code) throw error
|
250
259
|
typeDeclarationPath = resolve(typeDeclarationPath, "player.d.ts")
|
251
260
|
return writeFile(typeDeclarationPath, typeDeclaration)
|