diff --git a/CHANGELOG.md b/CHANGELOG.md index 814e1cd..35a6834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - feat: You can now configure custom loggers by calling `log.setup` before running the Arkiver instance. - feat: You can now configure the log level for the default console logger by passing in the `--log-level` flag to the `arkiver start` command. - feat: Enhanced the `arkiver init` command. You can now choose which template you want to initialize your arkive with. Templates are stored in the `examples` directory. -- chore: Clean up logging +- feat: Enhanced logging - fix: several bugfixes related to wildcard event handlers # v0.3.7 diff --git a/cli/init/mod.ts b/cli/init/mod.ts index fdfa375..69ef612 100644 --- a/cli/init/mod.ts +++ b/cli/init/mod.ts @@ -30,12 +30,14 @@ export const action = async ( spinner.stop() + const defaultPath = './cool-new-arkive' + const arkive = await prompt([ { name: 'dir', message: 'Where should we create your arkive?', type: Input, - default: './cool-new-arkive', + default: defaultPath, validate: (dir: string) => { if (!dir) return 'Please enter a path.' if (dir[0] !== '.') return 'Please enter a relative path.' @@ -57,14 +59,14 @@ export const action = async ( }, ]) - const dir = join(Deno.cwd(), arkive.dir ?? './cool-new-arkive') + const newDir = join(Deno.cwd(), arkive.dir ?? defaultPath) const template = arkive.template ?? templateNames[0].value spinner = wait('Initializing arkive...').start() const initRes = await $`svn export ${ options.overwrite ? `--force ` : '' - }https://github.com/RoboVault/robo-arkiver/trunk/examples/${template} ${dir}` + }https://github.com/RoboVault/robo-arkiver/trunk/examples/${template} ${newDir}` .captureCombined(true) if (initRes.code !== 0) { @@ -72,5 +74,19 @@ export const action = async ( return } + if (arkive.vscode) { + const dir = arkive.dir ?? defaultPath + await Deno.mkdir(join(Deno.cwd(), dir, '.vscode')) + + const vscode = `{ + "deno.enable": true, + "deno.unstable": true +}` + await Deno.writeTextFile( + join(Deno.cwd(), dir, '.vscode', 'settings.json'), + vscode, + ) + } + spinner.succeed('Initialized arkive') }