feat: allowing this to be ran in automated contexts
Signed-off-by: Alex Yong <alexjyong@gmail.com>
This commit is contained in:
parent
1b003918b0
commit
5bcf8a325a
|
|
@ -1,4 +1,14 @@
|
||||||
import { resolve } from "jsr:@std/path"
|
import { resolve } from "jsr:@std/path"
|
||||||
|
import { parseArgs } from "jsr:@std/cli/parse-args"
|
||||||
|
|
||||||
|
const args = parseArgs(Deno.args, {
|
||||||
|
boolean: ["yes", "y", "auto-accept"],
|
||||||
|
alias: {
|
||||||
|
"y": "yes"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const autoAccept = args.yes || args["auto-accept"]
|
||||||
|
|
||||||
const outputFolderParent = resolve(Deno.cwd(), "app", "src", "main", "assets")
|
const outputFolderParent = resolve(Deno.cwd(), "app", "src", "main", "assets")
|
||||||
|
|
||||||
|
|
@ -13,7 +23,7 @@ try {
|
||||||
console.error(
|
console.error(
|
||||||
"Usage: " +
|
"Usage: " +
|
||||||
"\x1b[35m" + // magenta
|
"\x1b[35m" + // magenta
|
||||||
"deno run -A scripts/download_deps.ts" +
|
"deno run -A scripts/download_deps.ts [--yes|-y|--auto-accept]" +
|
||||||
"\x1b[0m" +
|
"\x1b[0m" +
|
||||||
" from the " +
|
" from the " +
|
||||||
"\x1b[1;31;4m" + // bold red underline
|
"\x1b[1;31;4m" + // bold red underline
|
||||||
|
|
@ -299,10 +309,14 @@ for (const dep of deps) {
|
||||||
console.log(`- ${dep.file} from ${dep.url}`)
|
console.log(`- ${dep.file} from ${dep.url}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Will download the above files.")
|
if (!autoAccept) {
|
||||||
if (!confirm("Continue?")) {
|
console.log("Will download the above files.")
|
||||||
console.log("Aborted.")
|
if (!confirm("Continue?")) {
|
||||||
Deno.exit(0)
|
console.log("Aborted.")
|
||||||
|
Deno.exit(0)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Will download the above files. (auto-accepted)")
|
||||||
}
|
}
|
||||||
|
|
||||||
const fontsFolder = resolve(outputFolder, "fonts")
|
const fontsFolder = resolve(outputFolder, "fonts")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue