diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 91f2e3f2..7b70f8bf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "jdkDistro": "oracle" } }, - "postCreateCommand": "chmod +x gradlew && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && cp app/google-services.json.example app/google-services.json && git submodule update --init --recursive", + "postCreateCommand": "chmod +x gradlew && deno run -A scripts/download_deps.ts --yes && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && cp app/google-services.json.example app/google-services.json && git submodule update --init --recursive", "customizations": { "vscode": { "extensions": [ diff --git a/docs/src/content/docs/contributing/setup.mdx b/docs/src/content/docs/contributing/setup.mdx index 98b64492..88569a16 100644 --- a/docs/src/content/docs/contributing/setup.mdx +++ b/docs/src/content/docs/contributing/setup.mdx @@ -11,7 +11,7 @@ If you want to compile the app for yourself, you can also follow these guideline :::danger It may be tempting to skip some of these steps, but make sure you follow them to ensure that your development environment is set up correctly. -Note: If you are doing this in Github Codespaces, steps 1-10 (except 7) will be done for you. +Note: If you are doing this in Github Codespaces, steps 1-10 will be done for you. ::: import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" diff --git a/scripts/download_deps.ts b/scripts/download_deps.ts index 6476353b..c9d252ab 100644 --- a/scripts/download_deps.ts +++ b/scripts/download_deps.ts @@ -1,4 +1,14 @@ 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") @@ -13,7 +23,7 @@ try { console.error( "Usage: " + "\x1b[35m" + // magenta - "deno run -A scripts/download_deps.ts" + + "deno run -A scripts/download_deps.ts [--yes|-y|--auto-accept]" + "\x1b[0m" + " from the " + "\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("Will download the above files.") -if (!confirm("Continue?")) { - console.log("Aborted.") - Deno.exit(0) +if (!autoAccept) { + console.log("Will download the above files.") + if (!confirm("Continue?")) { + console.log("Aborted.") + Deno.exit(0) + } +} else { + console.log("Will download the above files. (auto-accepted)") } const fontsFolder = resolve(outputFolder, "fonts")