mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-03 00:41:27 +03:00
why
This commit is contained in:
18
src/stdin/npx.js
Normal file
18
src/stdin/npx.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const { StdinCommand } = require('@eartharoid/dbf');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
module.exports = class extends StdinCommand {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
id: 'npx',
|
||||
});
|
||||
}
|
||||
|
||||
async run(input) {
|
||||
if (!input[0]) return this.client.log.warn('Usage: npx <command> [args]');
|
||||
const child = spawn('npx', input, { shell: true });
|
||||
for await (const data of child.stdout) this.client.log.info('npx:', data.toString());
|
||||
for await (const data of child.stderr) this.client.warn.info('npx:', data.toString());
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user