feat: add asset flag for using cached artifact

This commit is contained in:
calebboyd
2021-01-26 07:16:14 -06:00
parent cf8e6ff393
commit 9f22309949
4 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "nexe",
"version": "4.0.0-beta.16",
"version": "4.0.0-beta.17",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "nexe",
"description": "Create a single executable out of your Node.js application",
"license": "MIT",
"version": "4.0.0-beta.16",
"version": "4.0.0-beta.17",
"contributors": [
"Craig Condon <craig.j.condon@gmail.com> (http://crcn.io)",
"Jared Allard <jaredallard@outlook.com>",
+4 -7
View File
@@ -110,13 +110,7 @@ export class NexeCompiler {
//SOMEDAY iterate over multiple targets with `--outDir`
this.targets = options.targets as NexeTarget[]
this.target = this.targets[0]
if (
!(
options.remote.startsWith('http://') ||
options.remote.startsWith('https://') ||
options.remote.startsWith('file://')
)
) {
if (!/https?\:\/\//.test(options.remote)) {
throw new NexeError(
`Invalid remote URI scheme (must be http, https, or file): ${options.remote}`
)
@@ -198,6 +192,9 @@ export class NexeCompiler {
}
public getNodeExecutableLocation(target?: NexeTarget) {
if (this.options.asset) {
return resolve(this.options.cwd, this.options.asset)
}
if (target) {
return join(this.options.temp, target.toString())
}
+2
View File
@@ -22,6 +22,7 @@ export interface NexeOptions {
targets: (string | NexeTarget)[]
name: string
remote: string
asset: string
cwd: string
fs: boolean | string[]
flags: string[]
@@ -77,6 +78,7 @@ const alias = {
i: 'input',
o: 'output',
v: 'version',
a: 'asset',
t: 'target',
b: 'build',
n: 'name',