-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node): add deleteOutputPath option to @nrwl/node:webpack executor
ISSUES CLOSED: #9167
- Loading branch information
1 parent
bef8240
commit edea1f2
Showing
6 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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,14 @@ | ||
import * as path from 'path'; | ||
import { removeSync } from 'fs-extra'; | ||
|
||
/** | ||
* Delete an output directory, but error out if it's the root of the project. | ||
*/ | ||
export function deleteOutputDir(root: string, outputPath: string) { | ||
const resolvedOutputPath = path.resolve(root, outputPath); | ||
if (resolvedOutputPath === root) { | ||
throw new Error('Output path MUST not be project root directory!'); | ||
} | ||
|
||
removeSync(resolvedOutputPath); | ||
} |
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