Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 6ba6f00

Browse files
btkostnergregberge
authored andcommitted
fix(shipit-deploy): only remove workspace if not shallow clone (#200)
1 parent f66c2bb commit 6ba6f00

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

packages/shipit-deploy/src/tasks/deploy/update.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ const updateTask = shipit => {
135135
}
136136

137137
async function removeWorkspace() {
138-
shipit.log(`Removing workspace "${shipit.workspace}"`)
139-
await rmfr(shipit.workspace)
140-
shipit.log(chalk.green('Workspace removed.'))
138+
if (shipit.config.shallowClone) {
139+
shipit.log(`Removing workspace "${shipit.workspace}"`)
140+
await rmfr(shipit.workspace)
141+
shipit.log(chalk.green('Workspace removed.'))
142+
}
141143
}
142144

143145
await setPreviousRelease()

packages/shipit-deploy/src/tasks/deploy/update.test.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,21 @@ describe('deploy:update task', () => {
226226
})
227227
})
228228

229-
it('should remove workspace', async () => {
229+
it('should remove workspace when shallow cloning', async () => {
230+
shipit.config.shallowClone = true
230231
stubShipit(shipit)
231232
rmfr.mockClear()
232233
expect(rmfr).not.toHaveBeenCalled()
233234
await start(shipit, 'deploy:update')
234235
expect(rmfr).toHaveBeenCalledWith('/tmp/workspace')
235236
})
237+
238+
it('should keep workspace when not shallow cloning', async () => {
239+
shipit.config.shallowClone = false
240+
stubShipit(shipit)
241+
rmfr.mockClear()
242+
expect(rmfr).not.toHaveBeenCalled()
243+
await start(shipit, 'deploy:update')
244+
expect(rmfr).not.toHaveBeenCalledWith('/tmp/workspace')
245+
})
236246
})

0 commit comments

Comments
 (0)