This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose CLI to build code on command (#2)
* Amends * Bin * Update * Test * Shell cmd * Updatye package.json * Run build * Test * Update * Post-install * Update * Test * Force build in pkg * Remove building tests * Delete src after build
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env node | ||
const path = require('path') | ||
const fs = require('fs') | ||
|
||
const dir = __dirname | ||
const root = path.resolve(dir, '..') | ||
|
||
const exists = fs.existsSync(path.resolve(root, './src')) | ||
if (!exists) { | ||
console.log('src already removed - skipping') | ||
process.exit(0) | ||
} | ||
|
||
const { spawn } = require('child_process') | ||
|
||
spawn('npm run build && rm -rf ./src', { cwd: root, shell: true, stdio: 'inherit' }) |
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