Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 3384d47

Browse files
committed
优化checkDirectoryName
1 parent 2a2990c commit 3384d47

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

create.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ function checkInputID(id: string): true | string {
7777
const filenameAntiChar = '\\/:*?"<>|'
7878

7979
function checkDirectoryName(name: string): true | string {
80+
let isAllDot = true
8081
for (const i of name) {
82+
if (i !== '.')
83+
isAllDot = false
8184
if (filenameAntiChar.includes(i))
8285
return 'Cannot contain characters: ' + filenameAntiChar
8386
}
87+
if (isAllDot)
88+
return 'Invalid name!'
8489
if (fs.existsSync(name))
8590
return 'Directory exists!'
8691
return true
@@ -196,7 +201,11 @@ for (const name of fs.readdirSync(leftPath(`src-public/locales`))) {
196201

197202

198203
console.log(`
204+
Next, run these commands to build the ccx file:
205+
199206
cd ${extensionDir}
200207
npm i
201208
npm run build
209+
210+
You can also use pnpm or yarn.
202211
`)

0 commit comments

Comments
 (0)