moved things
parent
ef6e0aacc6
commit
a2c5b141e0
|
|
@ -0,0 +1 @@
|
||||||
|
python-3.7.1.exe
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
let pythonPath = path.resolve(__dirname, '..', 'Python', 'python.exe');
|
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'});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "portapy",
|
"name": "portapy",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -217,6 +217,11 @@
|
||||||
"mime-db": "~1.37.0"
|
"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": {
|
"oauth-sign": {
|
||||||
"version": "0.9.0",
|
"version": "0.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"postinstall": "node postinstall.js",
|
"postinstall": "node postinstall.js",
|
||||||
"preuninstall": "node uninstall.js"
|
"preuninstall": "node uninstall.js",
|
||||||
|
"clean": "node clean.js"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"python": "bin/python.js"
|
"python": "bin/python.js"
|
||||||
|
|
@ -21,6 +22,7 @@
|
||||||
"url": "https://github.com/marcus13345/pythonjs/issues"
|
"url": "https://github.com/marcus13345/pythonjs/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"minimist": "^1.2.0",
|
||||||
"python": "0.0.4",
|
"python": "0.0.4",
|
||||||
"request": "2.88.0"
|
"request": "2.88.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
// const fs =
|
||||||
|
|
@ -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'
|
||||||
|
});
|
||||||
|
|
@ -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'
|
|
||||||
});
|
|
||||||
|
|
@ -20,6 +20,9 @@ async function download() {
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync('Python');
|
fs.mkdirSync('Python');
|
||||||
} catch(e) {'';}
|
} catch(e) {'';}
|
||||||
|
try {
|
||||||
|
fs.writeFileSync('.installerLocation', filename);
|
||||||
|
} catch(e) {'';}
|
||||||
// let installSettings = fs.readFileSync('unattend.xml');
|
// let installSettings = fs.readFileSync('unattend.xml');
|
||||||
|
|
||||||
let out_file = `Python-Installer/${filename}`
|
let out_file = `Python-Installer/${filename}`
|
||||||
|
|
@ -30,7 +33,6 @@ async function download() {
|
||||||
uri: url,
|
uri: url,
|
||||||
encoding: null
|
encoding: null
|
||||||
}, function (error, response, body) {
|
}, function (error, response, body) {
|
||||||
console.log(typeof body);
|
|
||||||
fs.writeFileSync(out_file, body, {});
|
fs.writeFileSync(out_file, body, {});
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
@ -86,7 +88,6 @@ function getPythonDownloadLink() {
|
||||||
let current_download_end = body.indexOf('">', current_download_start);
|
let current_download_end = body.indexOf('">', current_download_start);
|
||||||
let current_download = body.substring(current_download_start, current_download_end);
|
let current_download = body.substring(current_download_start, current_download_end);
|
||||||
|
|
||||||
console.log(current_download);
|
|
||||||
let url = current_download;
|
let url = current_download;
|
||||||
|
|
||||||
resolve(url);
|
resolve(url);
|
||||||
Reference in New Issue