This commit is contained in:
Thomas Hobson 2021-05-08 12:57:37 +12:00
parent 543cb11e69
commit 93188099b7
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
3 changed files with 15 additions and 12 deletions

View File

@ -8,7 +8,7 @@ exports.aliases = ['run'];
exports.describe = 'Executes file with the specified runner';
exports.builder = {
version: {
language_version: {
string: true,
desc: 'Set the version of the language to use',
alias: ['l'],
@ -55,7 +55,7 @@ exports.handler = async (argv) => {
const request = {
language: argv.language,
version: argv['language-version'],
version: argv['language_version'],
files: files,
args: argv.args,
stdin,

View File

@ -1,6 +1,6 @@
const chalk = require('chalk');
exports.command = ['install <language> [language-version]'];
exports.command = ['install <language> [language_version]'];
exports.aliases = ['i'];
exports.describe = 'Installs the named package';
@ -10,12 +10,14 @@ const msg_format = {
json: JSON.stringify
};
exports.handler = async ({ axios, language, version }) => {
exports.handler = async ({ axios, language, language_version }) => {
try {
const install = await axios.post(`/api/v2/packages`, {
const request = {
language,
version: version || '*'
});
version: language_version || '*'
};
const install = await axios.post(`/api/v2/packages`, request);
console.log(msg_format.color(install.data));
} catch ({ response }) {

View File

@ -1,6 +1,6 @@
const chalk = require('chalk');
exports.command = ['uninstall <language> [language-version]'];
exports.command = ['uninstall <language> [language_version]'];
exports.aliases = ['u'];
exports.describe = 'Uninstalls the named package';
@ -10,12 +10,13 @@ const msg_format = {
json: JSON.stringify
};
exports.handler = async ({ axios, language, version }) => {
exports.handler = async ({ axios, language, language_version }) => {
try {
const install = await axios.delete(`/api/v2/packages`, {
const request = {
language,
version: version || '*'
});
version: language_version || '*'
};
const uninstall = await axios.delete(`/api/v2/packages`, {data: request});
console.log(msg_format.color(uninstall.data));
} catch ({ response }) {