defiant-builder
Advanced tools
Comparing version 1.7.3 to 1.7.4
@@ -385,2 +385,3 @@ | ||
const Build = options => { | ||
let oautFilepath = "oauth-credentials.json" | ||
let destDir = options.destination | ||
@@ -410,4 +411,10 @@ | ||
let license = getMetaValue(meta, "license") | ||
let oauth = getMetaValue(meta, "oauth") | ||
// dev "run requirements" | ||
let runReqs = meta.find(item => item && item._attributes.name === "requires") | ||
let runRequires = runReqs ? {} : false | ||
if (runReqs) { | ||
runReqs.entry.map(item => runRequires[item._attributes.id] = item._attributes.description) | ||
} | ||
// perform build tasks - if any | ||
@@ -472,10 +479,10 @@ await buildTasks(appXmlDom, options.source, appId, namespace, options.uglify) | ||
if (oauth) { | ||
if (runRequires.oauth) { | ||
// copy oauth-file to public, if exist | ||
let srcOauth = FS.path.join(options.source, oauth) | ||
let srcOauth = FS.path.join(options.source, oautFilepath) | ||
if (await FS.fileExists(srcOauth)) { | ||
let destOauth = FS.path.join(destDir, oauth) | ||
let destOauth = FS.path.join(destDir, oautFilepath) | ||
await FS.copyFile(srcOauth, destOauth) | ||
} else { | ||
return reject("Couldn't locate OAuth file: "+ oauth) | ||
return reject(`Couldn't locate OAuth file: ${oautFilepath}`) | ||
} | ||
@@ -497,3 +504,3 @@ } | ||
await Promise.all(files.map(async entry => { | ||
if (oauth && entry === oauth) return | ||
if (runRequires.oauth && entry === oautFilepath) return | ||
let filePath = FS.path.join(destDir, entry) | ||
@@ -537,3 +544,3 @@ | ||
let rootFiles = ["icon.svg"] | ||
if (oauth) rootFiles.push(oauth) | ||
if (runRequires.oauth) rootFiles.push(oautFilepath) | ||
@@ -556,3 +563,3 @@ if (rootFiles.includes(entry)) { | ||
let buildInfo = { | ||
resolve({ | ||
version, | ||
@@ -566,13 +573,5 @@ name, | ||
buildDir: destDir.slice(process.cwd().length + 1), | ||
runRequires, | ||
files, | ||
} | ||
let runRequires = meta.find(item => item && item._attributes.name === "requires") | ||
if (runRequires) { | ||
buildInfo.runRequires = {} | ||
runRequires.entry.map(item => | ||
buildInfo.runRequires[item._attributes.id] = item._attributes.description) | ||
} | ||
resolve(buildInfo) | ||
}) | ||
}) | ||
@@ -579,0 +578,0 @@ } |
{ | ||
"name": "defiant-builder", | ||
"version": "1.7.3", | ||
"version": "1.7.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
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
57128