Add support for SVR.JS utility updates.
This commit is contained in:
parent
3aae68c2f2
commit
32a9efc3ba
3 changed files with 5 additions and 5 deletions
|
@ -6,5 +6,5 @@ To install SVR.JS type one of those commands:
|
||||||
```bash
|
```bash
|
||||||
create-svrjs-server lts #Latest SVR.JS LTS version
|
create-svrjs-server lts #Latest SVR.JS LTS version
|
||||||
create-svrjs-server latest #Latest SVR.JS version
|
create-svrjs-server latest #Latest SVR.JS version
|
||||||
create-svrjs-server 3.6.1 #SVR.JS 3.6.1 (replace 3.6.1 with your desired version)
|
create-svrjs-server 3.6.4 #SVR.JS 3.6.4 (replace 3.6.4 with your desired version)
|
||||||
```
|
```
|
||||||
|
|
|
@ -15,7 +15,7 @@ if(!version) {
|
||||||
console.log(" version - SVR.JS version you want to download");
|
console.log(" version - SVR.JS version you want to download");
|
||||||
console.log(" 'latest' -> latest SVR.JS version");
|
console.log(" 'latest' -> latest SVR.JS version");
|
||||||
console.log(" 'lts' -> latest LTS SVR.JS version");
|
console.log(" 'lts' -> latest LTS SVR.JS version");
|
||||||
console.log(" '3.6.1' -> SVR.JS 3.6.1");
|
console.log(" '3.6.4' -> SVR.JS 3.6.4");
|
||||||
} else if(version == "latest" || version == "lts") {
|
} else if(version == "latest" || version == "lts") {
|
||||||
https.get({
|
https.get({
|
||||||
hostname: "svrjs.org",
|
hostname: "svrjs.org",
|
||||||
|
@ -53,7 +53,7 @@ if(!version) {
|
||||||
} else {
|
} else {
|
||||||
downloadSVRJS(version);
|
downloadSVRJS(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadSVRJS(oversion) {
|
function downloadSVRJS(oversion) {
|
||||||
var version = oversion.toLowerCase().replace(/[^0-9a-z.]/g,".");
|
var version = oversion.toLowerCase().replace(/[^0-9a-z.]/g,".");
|
||||||
var path = "/dl/svr.js." + version + ".zip";
|
var path = "/dl/svr.js." + version + ".zip";
|
||||||
|
@ -85,7 +85,7 @@ function downloadSVRJS(oversion) {
|
||||||
var allFileNames = Object.keys(allFiles);
|
var allFileNames = Object.keys(allFiles);
|
||||||
for(var i=0;i<allFileNames.length;i++) {
|
for(var i=0;i<allFileNames.length;i++) {
|
||||||
var paths = allFileNames[i].split("/");
|
var paths = allFileNames[i].split("/");
|
||||||
if(!isSVRJSinstalled || allFileNames[i].match(/^(?:[^\/.]+\.compressed|svr(?:_new)?\.js|node_modules(?:\/|$))/)) {
|
if(!isSVRJSinstalled || allFileNames[i].match(/^(?:[^\/.]+\.compressed|(?:log(?:viewer|highlight)|svr(?:passwd|_new)?)\.js|node_modules(?:\/|$))/)) {
|
||||||
for(var j=0;j<paths.length-1;j++) {
|
for(var j=0;j<paths.length-1;j++) {
|
||||||
var dirname = JSON.parse(JSON.stringify(paths)).splice(0,j+1).join("/");
|
var dirname = JSON.parse(JSON.stringify(paths)).splice(0,j+1).join("/");
|
||||||
if(!fs.existsSync(dirname)) {
|
if(!fs.existsSync(dirname)) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "svrjs",
|
"name": "svrjs",
|
||||||
"version": "3.6.1-stub3",
|
"version": "3.6.4-stub1",
|
||||||
"description": "A web server running on Node.JS",
|
"description": "A web server running on Node.JS",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in a new issue