Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] fix(cli): Fix bug in build script #49

Merged
merged 2 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/src/scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {resolve} from 'path'
import {synchronizeFiles} from './synchronizer'
import {move, unlink, pathExists} from 'fs-extra'
import {move, remove, pathExists} from 'fs-extra'
import {Config, enhance} from './config'
import {nextBuild} from './next-utils'

Expand All @@ -17,6 +17,6 @@ export async function build(config: Config) {

const rootNextFolder = resolve(rootFolder, '.next')
const buildNextFolder = resolve(buildFolder, '.next')
if (await pathExists(rootNextFolder)) await unlink(rootNextFolder)
if (await pathExists(rootNextFolder)) await remove(rootNextFolder)
await move(buildNextFolder, rootNextFolder)
}
1 change: 1 addition & 0 deletions packages/cli/test/scripts/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const fsExtraMock = {
unlink: jest.fn(),
ensureDir: jest.fn(),
move: jest.fn(),
remove: jest.fn(),
pathExists: jest.fn(),
}

Expand Down