portapy commands

master
BrOakes 2018-11-21 20:42:39 -05:00
parent a0572460ca
commit 87a12a5a71
5 changed files with 79 additions and 62 deletions

View File

@ -0,0 +1,15 @@
#!/usr/bin/env node
let args = process.argv.slice(2);
if (args[0] == 'help' || args[0] == '?' || args[0] == 'h'){
console.log("heres some help");
} else if(args[0] == "version" || args[0] == "v") {
console.log("version number placeholder");
} else if (args[0] == "py" || args[0] == "pyversion") {
if (args[1]){
console.log(args[1]);
} else {
console.log("version of python");
}
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "portapy",
"version": "0.0.11",
"version": "0.0.13",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "portapy",
"version": "0.0.11",
"version": "0.0.13",
"description": "",
"main": "index.js",
"scripts": {
@ -10,7 +10,8 @@
"clean": "node clean.js"
},
"bin": {
"python": "bin/python.js"
"python": "bin/python.js",
"portapy": "index.js"
},
"repository": {
"type": "git",
@ -24,7 +25,6 @@
"dependencies": {
"copy-dir": "^0.4.0",
"minimist": "^1.2.0",
"python": "0.0.4",
"request": "^2.88.0"
},
"homepage": "https://github.com/marcus13345/portapy#readme"

View File

@ -71,7 +71,7 @@ async function download() {
console.log(err);
}
break;
}[]
}
}
}

View File

@ -3,16 +3,18 @@ module.exports = {
}
const request = require('request');
function versions()
{
return new Promise(resolve => {
// let matches = [];
let versions = function() {
new Promise(resolve => {
request({
uri: "https://www.python.org/ftp/python/",
}, function (error, response, body) {
const re = /"[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})*\/"/g;
let matches = body.match(re)
matches = body.match(re)
matches = matches.map((value) => {
return value.slice(1,-2)
return value.slice(1, -2);
});
resolve(matches);
});