-
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.
AutoCommit: Bump Repository (Update Repository Files)
- Loading branch information
1 parent
8c95728
commit bf22c4f
Showing
18 changed files
with
456 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
const { RegisterCommand, RegisterJSONCommand } = require("../CommandsHandler"); | ||
const InitCommand = require("./InitCommand"); | ||
const VersionCommand = require("./VersionCommand") | ||
const RunCommand = require("./RunCommand"); | ||
const VersionCommand = require("./VersionCommand"); | ||
const WatchCommand = require("./WatchCommand"); | ||
|
||
module.exports = (program) => { | ||
RegisterJSONCommand(program, VersionCommand()); | ||
RegisterJSONCommand(program, InitCommand()); | ||
RegisterJSONCommand(program, RunCommand()); | ||
RegisterJSONCommand(program, WatchCommand()); | ||
} |
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,40 @@ | ||
const path = require("path"); | ||
const { loadCurrentRedactConfig } = require("../../globals/ConfigurationTools"); | ||
const CommandBuilder = require("../CommandBuilder"); | ||
const figlet = require("figlet"); | ||
const chalk = require("cli-color"); | ||
const packageJSON = require("../../package.json"); | ||
const { Logger } = require("../.."); | ||
|
||
let text = ` | ||
d8888b. d88888b d8888b. .d8b. .o88b. d888888b .o88b. .d88b. d8888b. d8888b. | ||
88 \`8D 88' 88 \`8D d8' \`8b d8P Y8 \`oo88oo' d8P Y8 .8P Y8. 88 \`8D 88 \`8D | ||
88oobY' 88ooooo 88 88 88ooo88 8P 88 8P 88 88 88oobY' 88 88 | ||
88\`8b 88ooooo 88 88 88ooo88 8b 88 8b 88 88 88\`8b 88 88 | ||
88 \`88. 88. 88 .8D 88 88 Y8b d8 88 Y8b d8 \`8b d8' 88 \`88. 88 .8D | ||
88 YD Y88888P Y8888D' YP YP \`Y88P' YP \`Y88P' \`Y88P' 88 YD Y8888D\' v${packageJSON.version} | ||
` | ||
|
||
module.exports = () => { | ||
return CommandBuilder.createBuilder("run") | ||
.setDescription("Runs the current project") | ||
.setCallback(() => { | ||
|
||
const config = loadCurrentRedactConfig(); | ||
const main = config["main"]; | ||
|
||
const a = async () => { | ||
console.log(`${chalk.redBright(text)}`); | ||
} | ||
|
||
|
||
a().then(() => { | ||
if (!main || !main.length) | ||
return Logger.getLogger().error("Cannot find main field or main field is empty. Please provide a main path to a javascript file.") | ||
const p = path.join(process.cwd(), main); | ||
require(p); | ||
}) | ||
|
||
}); | ||
} |
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,26 @@ | ||
const fs = require("fs"); | ||
const watch = require("watch"); | ||
const _eval = require("eval"); | ||
const CommandBuilder = require("../CommandBuilder"); | ||
const path = require("path"); | ||
|
||
function HandleWatcher() { | ||
watch.watchTree(process.cwd(), { | ||
filter: (path, stat) => { | ||
console.log(path); | ||
return stat.isFile() && (path.endsWith(".js") || path.endsWith(".ts")) | ||
} | ||
}, (f, curr, prev) => { | ||
const data = fs.readdirSync(curr, "utf-8"); | ||
_eval(data); | ||
}); | ||
} | ||
|
||
module.exports = () => { | ||
return CommandBuilder.createBuilder("watch") | ||
.setDescription("Watches all files in the main directory") | ||
.setCallback((options) => { | ||
console.log(`[${new Date().toUTCString()}]: Started Watching files in the current directory.`); | ||
HandleWatcher(); | ||
}); | ||
} |
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,11 @@ | ||
const { readFileSync } = require("fs"); | ||
const path = require("path"); | ||
const { configName } = require("./InitializationUtils"); | ||
|
||
function loadCurrentRedactConfig() { | ||
return JSON.parse(readFileSync(path.join(process.cwd(), configName), "utf-8")); | ||
} | ||
|
||
module.exports = { | ||
loadCurrentRedactConfig | ||
}; |
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
Oops, something went wrong.