moved things

master
Marcus 2018-10-30 21:21:32 -04:00
parent ef6e0aacc6
commit a2c5b141e0
11 changed files with 27 additions and 12 deletions

View File

@ -0,0 +1 @@
python-3.7.1.exe

View File

@ -2,8 +2,9 @@
const path = require('path');
let pythonPath = path.resolve(__dirname, '..', 'Python', 'python.exe');
// const versions = require('./')
// console.log(process.argv);
let args = process.argv.slice(2);
require('child_process').spawn(pythonPath, [], {stdio: 'inherit'});
require('child_process').spawn(pythonPath, args, {stdio: 'inherit'});

7
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "portapy",
"version": "0.0.1",
"version": "0.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -217,6 +217,11 @@
"mime-db": "~1.37.0"
}
},
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",

View File

@ -6,7 +6,8 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "node postinstall.js",
"preuninstall": "node uninstall.js"
"preuninstall": "node uninstall.js",
"clean": "node clean.js"
},
"bin": {
"python": "bin/python.js"
@ -21,6 +22,7 @@
"url": "https://github.com/marcus13345/pythonjs/issues"
},
"dependencies": {
"minimist": "^1.2.0",
"python": "0.0.4",
"request": "2.88.0"
},

1
scripts/clean.js 100644
View File

@ -0,0 +1 @@
// const fs =

View File

@ -0,0 +1,10 @@
const path = require('path');
const fs = require('fs');
let installerFilename = fs.readFileSync('.installerLocation').toString();
let pythonPath = path.resolve(__dirname, 'Python-Installer', installerFilename);
require('child_process').execSync(`${pythonPath} /passive /uninstall`, {
stdio: 'inherit'
});

View File

@ -1,6 +0,0 @@
const path = require('path');
let pythonPath = path.resolve(__dirname, 'Python-Installer', 'python-3.7.1.exe');
require('child_process').execSync(`${pythonPath} /passive /uninstall`, {
stdio: 'inherit'
});

View File

@ -20,6 +20,9 @@ async function download() {
try {
fs.mkdirSync('Python');
} catch(e) {'';}
try {
fs.writeFileSync('.installerLocation', filename);
} catch(e) {'';}
// let installSettings = fs.readFileSync('unattend.xml');
let out_file = `Python-Installer/${filename}`
@ -30,7 +33,6 @@ async function download() {
uri: url,
encoding: null
}, function (error, response, body) {
console.log(typeof body);
fs.writeFileSync(out_file, body, {});
resolve();
});
@ -86,7 +88,6 @@ function getPythonDownloadLink() {
let current_download_end = body.indexOf('">', current_download_start);
let current_download = body.substring(current_download_start, current_download_end);
console.log(current_download);
let url = current_download;
resolve(url);

View File