-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
not sure what I changed but I changed a lot lol
- Loading branch information
Showing
32 changed files
with
4,948 additions
and
120 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
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 @@ | ||
module.exports = require('tpm/index'); |
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,19 @@ | ||
function TpmCommand(options, callback) { | ||
this.name = options.name; | ||
this.help = options.help; | ||
this.usage = options.usage; | ||
this.callback = callback; | ||
TpmCommand.registeredCommands.push(this); | ||
} | ||
|
||
TpmCommand.registeredCommands = []; | ||
|
||
TpmCommand.findCommand = function(name) { | ||
for (var i = 0; i < TpmCommand.registeredCommands.length; ++i) { | ||
var cmd = TpmCommand.registeredCommands[i]; | ||
if (cmd.name === name) return cmd; | ||
} | ||
return null; | ||
} | ||
|
||
module.exports = TpmCommand; |
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,21 +1,34 @@ | ||
var Command = require('tpm/command'); | ||
var assert = require('assert'); | ||
var tpmUtils = require('tpm/utils'); | ||
var consts = require('constants'); | ||
|
||
exports.init = init = require('tpm/init'); | ||
exports.install = install = require('tpm/install'); | ||
exports.ls = ls = require('tpm/ls'); | ||
exports.uninstall = uninstall = require('tpm/uninstall'); | ||
exports.update = update = require('tpm/update'); | ||
exports.version = version = require('tpm/version'); | ||
|
||
var repoUrl = 'https://api.github.com/repos/thiq/node_modules/contents/'; | ||
var repoUrl = tpmUtils.repoUrl; | ||
var registeredCommands = Command.registeredCommands; | ||
|
||
var modulesDir = process.config.modules_dir; | ||
|
||
registerCommand({ | ||
name: 'tpm', | ||
description: 'Commands for Thiq Package Manager', | ||
usage: '\xA7e<command>' | ||
usage: '\xA7e/<command> ' + registeredCommands.map(function(c) { return c.name }) | ||
}, function (sender, label, args) { | ||
assert(sender.isOp(), consts.defaultPermissionMessage); | ||
if (!args || args.length == 0) { | ||
if (!args || args.length === 0) { | ||
return false; | ||
} | ||
var cmd = Command.findCommand(args[0]); | ||
if (!cmd) return false; | ||
if (!cmd.callback) { | ||
sender.sendMessage('This command is currenly not implemented'); | ||
return; | ||
} | ||
return cmd.callback(sender, label, args); | ||
}); |
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,9 @@ | ||
var Command = require('tpm/command'); | ||
|
||
module.exports = new Command({ | ||
name: 'init', | ||
help: 'Executes the initialization function to setup a module', | ||
usage: '\xA7c/tpm init [module name]' | ||
}, function(sender, label, args) { | ||
|
||
}); |
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,9 @@ | ||
var Command = require('tpm/command'); | ||
|
||
module.exports = new Command({ | ||
name: 'ls', | ||
help: 'Lists all installed modules for the current server', | ||
usage: '\xA7c/tpm ls' | ||
}, function(sender, label, args) { | ||
|
||
}); |
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,9 @@ | ||
var Command = require('tpm/command'); | ||
|
||
module.exports = new Command({ | ||
name: 'uninstall', | ||
help: 'Uninstalls a module from this server', | ||
usage: '\xA7c/tpm uninstall [module name]' | ||
}, function(sender, label, args) { | ||
|
||
}); |
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,9 @@ | ||
var Command = require('tpm/command'); | ||
|
||
module.exports = new Command({ | ||
name: 'update', | ||
help: 'Updates all modules unless a specific module is supplied', | ||
usage: '\xA7c/tpm update <module name> <version>' | ||
}, function(sender, label, args) { | ||
|
||
}); |
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,5 @@ | ||
var repoUrl = 'https://api.github.com/repos/thiq/node_modules/contents/'; | ||
|
||
module.exports = { | ||
repoUrl | ||
} |
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,9 @@ | ||
var Command = require('tpm/command'); | ||
|
||
module.exports = new Command({ | ||
name: 'version', | ||
help: 'Displays the version of the specified module', | ||
usage: '\xA7c/tpm version [module name]' | ||
}, function(sender, label, args) { | ||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.