From ab54372d169af09d68e13b5f6b6ad42cb613dfb8 Mon Sep 17 00:00:00 2001 From: Marcus Date: Tue, 30 Oct 2018 18:17:19 -0400 Subject: [PATCH] tabs lmao --- Download-Latest-Python/downloadpython.js | 116 +++++++++++------------ 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/Download-Latest-Python/downloadpython.js b/Download-Latest-Python/downloadpython.js index bd259d0..94ce20b 100644 --- a/Download-Latest-Python/downloadpython.js +++ b/Download-Latest-Python/downloadpython.js @@ -7,68 +7,68 @@ let path = require('path'); let waitOn = require('wait-on'); request({ - uri: "https://www.python.org/downloads/", + uri: "https://www.python.org/downloads/", }, function (error, response, body) { - - let os_string = os.platform(); - let current_os = ''; - switch (os_string) - { - case 'darwin': - current_os = "download-os-mac-osx"; - break; - case 'linux': - current_os = "download-os-source"; - break; - case 'win32': - current_os = "download-os-windows"; - break; - default: - current_os = "download-os-source"; - break; - } + + let os_string = os.platform(); + let current_os = ''; + switch (os_string) + { + case 'darwin': + current_os = "download-os-mac-osx"; + break; + case 'linux': + current_os = "download-os-source"; + break; + case 'win32': + current_os = "download-os-windows"; + break; + default: + current_os = "download-os-source"; + break; + } - let current_download_start = body.indexOf("href=",body.indexOf(current_os)) + 6; - let current_download_end = body.indexOf('">', current_download_start); - let current_download = body.substring(current_download_start, current_download_end); + let current_download_start = body.indexOf("href=",body.indexOf(current_os)) + 6; + let current_download_end = body.indexOf('">', current_download_start); + let current_download = body.substring(current_download_start, current_download_end); - // function downlaod_python() - // { - // return new Promise(function (resolve, reject) { - let file_name = current_download.substring(current_download.indexOf('/', current_download.indexOf('/python/') + 8) + 1); - // console.log(file_name); - let out_file = fs.createWriteStream(`../Python-Installer/${file_name}`); - - let file_request = https.get(current_download, function (response) { - response.pipe(out_file); - }); - // resolve("Python Downloaded"); - // }) - // } + // function downlaod_python() + // { + // return new Promise(function (resolve, reject) { + let file_name = current_download.substring(current_download.indexOf('/', current_download.indexOf('/python/') + 8) + 1); + // console.log(file_name); + let out_file = fs.createWriteStream(`../Python-Installer/${file_name}`); + + let file_request = https.get(current_download, function (response) { + response.pipe(out_file); + }); + // resolve("Python Downloaded"); + // }) + // } - // function install_python() - // { - // return new Promise(function (resolve, reject) - // { - switch (os_string) - { - case 'win32': - try { - cmd.run(`${path.join(__dirname, '/../', 'Python-Installer/', file_name)} /quiet DefaultJustForMeTargetDir=${path.join(__dirname, '/../', 'Python/')}`); - resolve("Python Installed"); - } catch (err) { - console.log(err); - } - break; - } - // }) - // } - // async function main() - // { - // await downlaod_python(); - // await install_python(); - // console.log("Done"); - // } + // function install_python() + // { + // return new Promise(function (resolve, reject) + // { + switch (os_string) + { + case 'win32': + try { + cmd.run(`${path.join(__dirname, '/../', 'Python-Installer/', file_name)} /quiet DefaultJustForMeTargetDir=${path.join(__dirname, '/../', 'Python/')}`); + resolve("Python Installed"); + } catch (err) { + console.log(err); + } + break; + } + // }) + // } + // async function main() + // { + // await downlaod_python(); + // await install_python(); + // console.log("Done"); + // } });