qcobjects-cli
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -43,3 +43,4 @@ /** | ||
logger.debugEnabled=false; | ||
CONFIG.set('qcobjectsnewapp_path','./node_modules/qcobjectsnewapp'); | ||
CONFIG.set('node_modules_path','./node_modules/'); | ||
CONFIG.set('qcobjectsnewapp_path',CONFIG.get('node_modules_path')+'/qcobjectsnewapp'); | ||
@@ -139,3 +140,3 @@ | ||
}, | ||
create:function (_appName){ | ||
create:function (_appName, options){ | ||
let switchCommander = this; | ||
@@ -149,3 +150,14 @@ let appName = (typeof _appName ==='undefined' || _appName === true)?('MyAppName'):(_appName); | ||
let createAppCommand = "echo \"{\\\"name\\\": \\\""+appName.toLowerCase()+"\\\",\\\"repository\\\": {\\\"type\\\": \\\"git\\\",\\\"url\\\": \\\""+giturl+"\\\"},\\\"description\\\":\\\".\\\",\\\"license\\\": \\\"LGPL-3.0-or-later\\\",\\\"dependencies\\\":{\\\"qcobjectsnewapp\\\":\\\"latest\\\",\\\"qcobjects\\\":\\\"latest\\\"}}\" > package.json"; | ||
let createAppCommandPWA = "echo \"{\\\"name\\\": \\\""+appName.toLowerCase()+"\\\",\\\"repository\\\": {\\\"type\\\": \\\"git\\\",\\\"url\\\": \\\""+giturl+"\\\"},\\\"description\\\":\\\".\\\",\\\"license\\\": \\\"LGPL-3.0-or-later\\\",\\\"dependencies\\\":{\\\"qcobjectsnewapp\\\":\\\"latest\\\",\\\"qcobjects\\\":\\\"latest\\\"}}\" > package.json"; | ||
let createAppCommandAMP = "echo \"{\\\"name\\\": \\\""+appName.toLowerCase()+"\\\",\\\"repository\\\": {\\\"type\\\": \\\"git\\\",\\\"url\\\": \\\""+giturl+"\\\"},\\\"description\\\":\\\".\\\",\\\"license\\\": \\\"LGPL-3.0-or-later\\\",\\\"dependencies\\\":{\\\"qcobjects-ecommerce-amp\\\":\\\"latest\\\",\\\"qcobjects\\\":\\\"latest\\\"}}\" > package.json"; | ||
let createAppCommand; | ||
if (options.createAmp){ | ||
CONFIG.set('qcobjectsnewapp_path',CONFIG.get('node_modules_path')+'/qcobjects-ecommerce-amp'); | ||
createAppCommand = createAppCommandAMP; | ||
} else { | ||
CONFIG.set('qcobjectsnewapp_path',CONFIG.get('node_modules_path')+'/qcobjectsnewapp'); | ||
createAppCommand = createAppCommandPWA; | ||
} | ||
logger.debug(createAppCommand); | ||
@@ -152,0 +164,0 @@ exec(createAppCommand, (err, stdout, stderr) => { |
@@ -65,15 +65,30 @@ /** | ||
const fd = fs.openSync(fileName, "r"); | ||
const stat = fs.fstatSync(fd); | ||
const headers = { | ||
"content-length": stat.size, | ||
"last-modified": stat.mtime.toUTCString(), | ||
"content-type": mime.getType(fileName) | ||
}; | ||
stream.respondWithFD(fd, headers); | ||
stream.on("close", () => { | ||
console.log("closing file", fileName); | ||
fs.closeSync(fd); | ||
}); | ||
stream.end(); | ||
try { | ||
const fd = fs.openSync(fileName, "r"); | ||
const stat = fs.fstatSync(fd); | ||
const headers = { | ||
"content-length": stat.size, | ||
"last-modified": stat.mtime.toUTCString(), | ||
"content-type": mime.getType(fileName) | ||
}; | ||
stream.respondWithFD(fd, headers); | ||
stream.on("close", () => { | ||
console.log("closing file", fileName); | ||
fs.closeSync(fd); | ||
}); | ||
stream.end(); | ||
} catch (e){ | ||
if (e.errno==-2){ | ||
const headers = { | ||
':status': 404, | ||
'content-type': 'text/html' | ||
}; | ||
stream.write('<h1>404 - FILE NOT FOUND</h1>'); | ||
stream.on("close", () => { | ||
console.log("closing file", fileName); | ||
}); | ||
stream.end(); | ||
} | ||
} | ||
}, | ||
@@ -80,0 +95,0 @@ _generateResponse:function (){ |
{ | ||
"name": "qcobjects-cli", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "qcobjects cli command line tool", | ||
@@ -5,0 +5,0 @@ "main": "qcobjects-cli.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37085
773