-
Notifications
You must be signed in to change notification settings - Fork 443
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
1 parent
b333c86
commit a849bc3
Showing
3 changed files
with
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
async function run() { | ||
const args = process.argv.slice(2); | ||
const task = args[0]; | ||
|
||
if (!task) { | ||
panic('Missing partytown task argument. Example command: partytown copylib dest/directory'); | ||
} | ||
|
||
switch (task) { | ||
case 'copylib': { | ||
await copyLibTask(args); | ||
break; | ||
} | ||
default: { | ||
panic('Unknown partytown task: ' + task); | ||
} | ||
} | ||
} | ||
|
||
async function copyLibTask(args) { | ||
try { | ||
const utils = require('../utils/index.cjs'); | ||
const destDir = args[1]; | ||
const result = await utils.copyLibFiles(destDir); | ||
|
||
if (!args.includes('--silent')) { | ||
console.log('Partytown lib copied to: ' + result.dest); | ||
} | ||
} catch (e) { | ||
panic(String(e.message || e)); | ||
} | ||
} | ||
|
||
function panic(msg) { | ||
console.error('❌ ' + msg); | ||
process.exit(1); | ||
} | ||
|
||
run(); |
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
a849bc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: