summaryrefslogtreecommitdiff
path: root/packages/create-astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/create-astro')
-rw-r--r--packages/create-astro/README.md1
-rw-r--r--packages/create-astro/package.json2
-rw-r--r--packages/create-astro/src/index.ts10
3 files changed, 10 insertions, 3 deletions
diff --git a/packages/create-astro/README.md b/packages/create-astro/README.md
index d8dca6c24..661d56f48 100644
--- a/packages/create-astro/README.md
+++ b/packages/create-astro/README.md
@@ -42,6 +42,7 @@ May be provided in place of prompts
|:-------------|:----------------------------------------------------|
| `--template` | Specify the template name ([list][examples]) |
| `--commit` | Specify a specific Git commit or branch to use from this repo (by default, `main` branch of this repo will be used) |
+| `--fancy` | For Windows users, `--fancy` will enable full unicode support |
### Debugging
diff --git a/packages/create-astro/package.json b/packages/create-astro/package.json
index 7c2bd6661..d4445581e 100644
--- a/packages/create-astro/package.json
+++ b/packages/create-astro/package.json
@@ -29,7 +29,7 @@
"tsconfigs"
],
"dependencies": {
- "@astrojs/cli-kit": "^0.1.0",
+ "@astrojs/cli-kit": "^0.1.3",
"chalk": "^5.0.1",
"comment-json": "^4.2.3",
"execa": "^6.1.0",
diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts
index 2c9da9d66..dcd5c98ab 100644
--- a/packages/create-astro/src/index.ts
+++ b/packages/create-astro/src/index.ts
@@ -1,5 +1,6 @@
/* eslint no-console: 'off' */
import { color, generateProjectName, label, say } from '@astrojs/cli-kit';
+import { forceUnicode } from '@astrojs/cli-kit/utils';
import { random } from '@astrojs/cli-kit/utils';
import { assign, parse, stringify } from 'comment-json';
import { execa, execaCommand } from 'execa';
@@ -29,9 +30,14 @@ import { TEMPLATES } from './templates.js';
// broke our arg parser, since `--` is a special kind of flag. Filtering for `--` here
// fixes the issue so that create-astro now works on all npm version.
const cleanArgv = process.argv.filter((arg) => arg !== '--');
-const args = yargs(cleanArgv);
+const args = yargs(cleanArgv, { boolean: ['fancy']});
prompts.override(args);
+// Enable full unicode support if the `--fancy` flag is passed
+if (args.fancy) {
+ forceUnicode();
+}
+
export function mkdirp(dir: string) {
try {
fs.mkdirSync(dir, { recursive: true });
@@ -99,7 +105,7 @@ export async function main() {
`${username}!`,
],
random(welcome),
- ]);
+ ], { hat: args.fancy ? '🎩' : undefined });
await banner(version);
}