-
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
dbc6251
commit ac18c1a
Showing
9 changed files
with
141 additions
and
43 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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
const { RegisterCommand, RegisterJSONCommand } = require("../CommandsHandler"); | ||
const InitCommand = require("./InitCommand"); | ||
const RunCommand = require("./RunCommand"); | ||
const TemplateCommand = require("./TemplateCommand"); | ||
const VersionCommand = require("./VersionCommand"); | ||
|
||
module.exports = (program) => { | ||
RegisterJSONCommand(program, VersionCommand()); | ||
RegisterJSONCommand(program, InitCommand()); | ||
RegisterJSONCommand(program, RunCommand()); | ||
RegisterJSONCommand(program, TemplateCommand()) | ||
} |
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,39 @@ | ||
const CommandBuilder = require("../CommandBuilder"); | ||
const Templates = require("@redactcord/templates"); | ||
const simpleGit = require("simple-git"); | ||
const git = simpleGit.default(process.cwd()) | ||
|
||
module.exports = () => { | ||
return CommandBuilder.createBuilder("template") | ||
.setDescription("Displays or Creates templates") | ||
.addArgument("[template]") | ||
.setCallback((template) => { | ||
const templates = Templates.TEMPLATES; | ||
if (!template) { | ||
|
||
if (!templates.length) | ||
return console.log("No Templates are found at this current time. templates package may have not been updated in the main package"); | ||
|
||
let tab = ` `; | ||
let string = ``; | ||
|
||
for (const template of templates) { | ||
string += `${tab}|-${template}\n`; | ||
} | ||
|
||
console.log(string.trim()); | ||
} else { | ||
|
||
const index = templates.indexOf(template); | ||
if (index == -1) | ||
return console.log("Not Present in the templates list."); | ||
const templateValue = templates[index]; | ||
const url = `${Templates.GithubPrefix}${templateValue}`; | ||
|
||
git.clone(url, process.cwd()).then((value) => { | ||
console.log("Cloned Template " + templateValue + " to " + process.cwd()); | ||
}); | ||
} | ||
|
||
}); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const TEMPLATES: string[]; | ||
export const GithubPrefix: string; |
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,4 @@ | ||
module.exports = { | ||
TEMPLATES: [], | ||
GithubPrefix: "https://github.com/" | ||
} |
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,24 @@ | ||
{ | ||
"name": "@redactcord/templates", | ||
"version": "0.0.1", | ||
"description": "Provides all template urls for the main package", | ||
"main": "index.js", | ||
"typings": "index.d.ts", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Max Jackson", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/redactdev/redactcord.git" | ||
}, | ||
"keywords": [ | ||
"urls", | ||
"templates" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/redactdev/redactcord/issues" | ||
}, | ||
"homepage": "https://github.com/redactdev/redactcord#readme" | ||
} |
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