Update start.js (#175)

Compatible with repository addresses using http protocol.
This commit is contained in:
Kerwin Bryant 2023-07-28 01:41:00 +08:00 committed by GitHub
parent d9117be7ca
commit f8e0bce133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,10 @@
'use strict';
const spawn = require('child_process').spawn;
const path = require("path");
const http = require('http');
const https = require('https');
const get = (url, options = {}) => new Promise((resolve, reject) => https
const get = (url, options = {}) => new Promise((resolve, reject) => ((url.protocol == "https:") ? https : http)
.get(url, options, (res) => {
const chunks = [];
res.on('data', (chunk) => chunks.push(chunk));