Compare commits

..

2 Commits

Author SHA1 Message Date
calebboyd 9f22309949 feat: add asset flag for using cached artifact 2021-01-26 07:16:29 -06:00
calebboyd cf8e6ff393 fix: got upload searchParams 2021-01-05 12:47:29 -06:00
5 changed files with 10 additions and 11 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',
+2 -2
View File
@@ -3,7 +3,7 @@ import { getUnBuiltReleases, getLatestGitRelease } from '../lib/releases'
import { runDockerBuild } from './docker'
import { getTarget, targetsEqual, NexeTarget } from '../lib/target'
import { pathExistsAsync, readFileAsync, execFileAsync, semverGt } from '../lib/util'
import got = require('got')
import got from 'got'
import { cpus } from 'os'
const env = process.env,
@@ -86,7 +86,7 @@ async function build() {
return
}
await got(gitRelease.upload_url.split('{')[0], {
query: { name: target.toString() },
searchParams: { name: target.toString() },
body: await readFileAsync(output),
headers: {
...headers,