Skip to content

Commit 516d92e

Browse files
committed
Use timestamp for unique dir name
1 parent ba63694 commit 516d92e

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import chalk from "chalk";
44
import { exec } from "child_process";
55
import fs from "fs";
6-
import { nanoid } from "nanoid";
76
import path from "path";
87
import readline from "readline";
98
import util from "util";
@@ -62,10 +61,10 @@ const starter = config.starters.find(
6261
(s) => s.name === (args.starter ?? config.defaults.starter.name)
6362
);
6463

65-
const timestamp = new Date().getTime();
64+
// Current time in seconds.
65+
const timestamp = Math.round(new Date().getTime() / 1000);
6666

67-
const dirName =
68-
args._[0] ?? `${config.defaults.dirName}-${nanoid(8).toLowerCase()}`;
67+
const dirName = args._[0] ?? `${config.defaults.dirName}-${timestamp}`;
6968

7069
/* --- New Project from Starter --- */
7170

package-lock.json

Lines changed: 0 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"type": "module",
1616
"dependencies": {
1717
"chalk": "^5.0.0",
18-
"nanoid": "^3.3.4",
1918
"yargs": "^17.3.1"
2019
}
2120
}

0 commit comments

Comments
 (0)