Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
21 deletions.
There are no files selected for viewing
Submodule nw-data
updated
70 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { program } from 'commander' | ||
import * as fs from 'fs' | ||
import { NW_GAME_VERSION, environment } from '../env' | ||
|
||
program.option('-ws, --workspace <name>', 'workspace dir (live or ptr)', NW_GAME_VERSION).action(async () => { | ||
const options = program.opts<{ | ||
workspace: boolean | ||
}>() | ||
|
||
const unpackDir = environment.nwUnpackDir(options.workspace)! | ||
const convertDir = environment.nwConvertDir(options.workspace)! | ||
|
||
console.log('[CLEAN]', options.workspace) | ||
console.log(' unpack dir:', unpackDir) | ||
console.log('convert dir:', convertDir) | ||
|
||
if (fs.existsSync(unpackDir)) { | ||
console.log('Cleaning unpack directory...') | ||
await fs.promises.rm(unpackDir, { recursive: true }) | ||
} | ||
if (fs.existsSync(convertDir)) { | ||
console.log('Cleaning convert directory...') | ||
await fs.promises.rm(convertDir, { recursive: true }) | ||
} | ||
}) | ||
|
||
program.parse() |