From 129c2f86a0c25311c506538f220c814ed7f0c258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Nuno=20Monteiro?= Date: Sat, 20 Oct 2018 17:16:41 +0100 Subject: [PATCH] fix: include snapshot in patches (#539) --- src/patches/index.ts | 3 ++- src/patches/snapshot.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/patches/index.ts b/src/patches/index.ts index 9d4ad5c..8697313 100644 --- a/src/patches/index.ts +++ b/src/patches/index.ts @@ -5,7 +5,8 @@ import cli from './disable-node-cli' import flags from './flags' import ico from './ico' import rc from './node-rc' +import snapshot from './snapshot' -const patches = [gyp, bootNexe, buildFixes, cli, flags, ico, rc] +const patches = [gyp, bootNexe, buildFixes, cli, flags, ico, rc, snapshot] export default patches diff --git a/src/patches/snapshot.ts b/src/patches/snapshot.ts index fabe1b6..f3f1c7d 100644 --- a/src/patches/snapshot.ts +++ b/src/patches/snapshot.ts @@ -1,3 +1,4 @@ +import * as path from 'path' import { NexeCompiler } from '../compiler' export default async function snapshot(compiler: NexeCompiler, next: () => Promise) { @@ -11,8 +12,8 @@ export default async function snapshot(compiler: NexeCompiler, next: () => Promi await compiler.replaceInFileAsync( 'configure', 'def configure_v8(o):', - `def configure_v8(o):\n o['variables']['embed_script'] = '${snapshotFile}'\n o['variables']['warmup_script'] = '${warmupScript || - snapshotFile}'` + `def configure_v8(o):\n o['variables']['embed_script'] = r'${path.resolve(snapshotFile)}'\n o['variables']['warmup_script'] = r'${path.resolve(warmupScript || + snapshotFile)}'` ) return next()