Skip to content

Commit

Permalink
chore: use rm instead of rmdir
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Aug 13, 2024
1 parent 11f9f46 commit 87d2d4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"dev": "npm run build && node samples/rimraf.js && node bin/index.js",
"build": "npm run rimraf && tsc",
"rimraf": "node -e \"require('fs').existsSync('dist') && require('fs').rmdirSync('dist', { recursive: true })\"",
"rimraf": "node -e \"require('fs').existsSync('dist') && require('fs').rmSync('dist', { recursive: true })\"",
"lint": "eslint --ext .ts . && prettier --check \"./**/*.ts\"",
"lint:fix": "eslint --ext .ts . --fix && prettier --write \"./**/*.ts\"",
"test": "vitest run",
Expand Down
4 changes: 2 additions & 2 deletions samples/rimraf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// for $ npm run dev:openapi
// for $ npm run dev
require('fs')
.readdirSync(__dirname)
.filter(n => require('fs').statSync(`${__dirname}/${n}`).isDirectory() && n !== 'docs.baikalplatform.com')
.forEach(n =>
require('fs').rmdir(`${__dirname}/${n}`, { recursive: true }, err => {
require('fs').rm(`${__dirname}/${n}`, { recursive: true }, err => {
if (err) console.log(err)
})
)

0 comments on commit 87d2d4a

Please sign in to comment.