From aeb33e0c94ade620de10908a00683f7f2ae09cc0 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 29 Aug 2018 07:45:19 +0100 Subject: [PATCH] fix: nuxt-start-edge missing resources --- scripts/release-edge | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/release-edge b/scripts/release-edge index 241b43d454..3d70f3450f 100755 --- a/scripts/release-edge +++ b/scripts/release-edge @@ -1,15 +1,16 @@ #!/usr/bin/env node -const { resolve } = require('path') +const { resolve, join } = require('path') const { spawnSync } = require('child_process') -const { readFileSync, writeFileSync, copySync, ensureDirSync } = require('fs-extra') +const { readFileSync, writeFileSync, copySync } = require('fs-extra') class NuxtEdgePublisher { - static copyBin(moduleName, binName) { - const binFile = resolve(__dirname, '..', 'bin', binName) - const moduleBin = resolve(__dirname, '..', moduleName, 'bin') - ensureDirSync(moduleBin) - copySync(binFile, resolve(moduleBin, binName)) + static copyFiles(moduleName, src, fieNames) { + const srcDir = resolve(__dirname, '..', src) + const moduleDir = resolve(__dirname, '..', moduleName, src) + for (const file of fieNames) { + copySync(resolve(srcDir, file), resolve(moduleDir, file)) + } } static changePackageName(module = '') { @@ -43,7 +44,8 @@ class NuxtEdgePublisher { writeFileSync(packagePath, JSON.stringify(p, null, 2) + '\r\n') if (module === 'start') { - this.copyBin('start', 'nuxt-start') + this.copyFiles(module, 'dist', ['nuxt-start.js']) + this.copyFiles(module, 'bin', ['nuxt-start', join('common', 'utils.js')]) } return p