mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 09:20:01 +02:00
🎉 Copy all the melon code over
This commit is contained in:
parent
f32d867abc
commit
5777e350af
38 changed files with 2727 additions and 0 deletions
26
src/commands/execute.ts
Normal file
26
src/commands/execute.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { existsSync } from "fs";
|
||||
import { log } from "..";
|
||||
import { ENGINE_DIR } from "../constants";
|
||||
import { dispatch } from "../utils";
|
||||
|
||||
export const execute = async (_: any, cmd: any[]) => {
|
||||
if (existsSync(ENGINE_DIR)) {
|
||||
if (!cmd || cmd.length == 0)
|
||||
log.error(
|
||||
"You need to specify a command to run."
|
||||
);
|
||||
|
||||
const bin = cmd[0];
|
||||
const args = cmd;
|
||||
args.shift();
|
||||
|
||||
log.info(
|
||||
`Executing \`${bin}${
|
||||
args.length !== 0 ? ` ` : ``
|
||||
}${args.join(" ")}\` in \`src\`...`
|
||||
);
|
||||
dispatch(bin, args, ENGINE_DIR, true);
|
||||
} else {
|
||||
log.error(`Unable to locate src directory.`);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue