From 43905686540f21f49f7c8cd19d0c59c721e902cb Mon Sep 17 00:00:00 2001 From: calebboyd Date: Wed, 27 Sep 2017 00:55:06 -0500 Subject: [PATCH] fix: ia32 target normalization --- appveyor.yml | 4 ++-- src/target.ts | 3 ++- tasks/asset-compile.ts | 8 ++++---- tasks/ci.ts | 2 +- tasks/docker.ts | 4 ++-- tasks/post-build.ts | 4 +++- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b59d08c..33a08bb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,11 +7,11 @@ environment: secure: 3wuEGJsppSKFvdwhp3jprUA9Zkc3WINlc/9oFXjhAR6J05lYMXP7Fl7lXTKpkGZx install: - ps: Install-Product node 6 - - npm i + - yarn build: off test: off build_script: - - npm run asset-compile + - yarn run asset-compile artifacts: - path: .nexe\**\node.exe cache: diff --git a/src/target.ts b/src/target.ts index 231ab2b..d703695 100644 --- a/src/target.ts +++ b/src/target.ts @@ -63,7 +63,8 @@ export function targetsEqual(a: NexeTarget, b: NexeTarget) { } export function getTarget(target: string | Partial = ''): NexeTarget { - let arch = process.arch as NodeArch, + const currentArch = process.arch + let arch = currentArch in prettyArch ? prettyArch[process.arch] : process.arch as NodeArch, platform = prettyPlatform[process.platform], version = process.version.slice(1) diff --git a/tasks/asset-compile.ts b/tasks/asset-compile.ts index b11b727..50c0e4d 100644 --- a/tasks/asset-compile.ts +++ b/tasks/asset-compile.ts @@ -1,12 +1,12 @@ -import * as nexe from '../src/nexe' +import * as nexe from '../lib/nexe' import { getUnBuiltReleases, getLatestGitRelease -} from '../src/releases' +} from '../lib/releases' import * as ci from './ci' import { runAlpineBuild } from './docker' -import { getTarget } from '../src/target' -import { pathExistsAsync, statAsync, readFileAsync, execFileAsync } from '../src/util' +import { getTarget } from '../lib/target' +import { pathExistsAsync, statAsync, readFileAsync, execFileAsync } from '../lib/util' import got = require('got') const env = process.env, diff --git a/tasks/ci.ts b/tasks/ci.ts index 70d4356..66d08cd 100644 --- a/tasks/ci.ts +++ b/tasks/ci.ts @@ -1,4 +1,4 @@ -import { NexeTarget } from '../src/releases' +import { NexeTarget } from '../lib/releases' import got = require('got') import * as assert from 'assert' const { env } = process diff --git a/tasks/docker.ts b/tasks/docker.ts index b032813..8b6d860 100644 --- a/tasks/docker.ts +++ b/tasks/docker.ts @@ -1,5 +1,5 @@ -import { NexeTarget } from '../src/target' -import { writeFileAsync, readFileAsync } from '../src/util' +import { NexeTarget } from '../lib/target' +import { writeFileAsync, readFileAsync } from '../lib/util' import { spawn } from 'child_process' import got = require('got') import { createWriteStream, WriteStream } from 'fs' diff --git a/tasks/post-build.ts b/tasks/post-build.ts index b0889bd..bfe4448 100644 --- a/tasks/post-build.ts +++ b/tasks/post-build.ts @@ -20,9 +20,11 @@ function inject (filename: string, ...replacements: string[]) { if (replace !== 'replace') { return substring } + console.log('Replacing: ', substring) return replacements[+file] ? replacements[+file] : JSON.stringify(readFileSync(file, 'utf8')) - }) + }) writeFileSync(filename, contents) + console.log(`Wrote: ${filename}`) }