Skip to content

Commit

Permalink
ignore error on failed git pull during deploy (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn authored Apr 23, 2021
1 parent cdbe4f8 commit b61dcf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Gro changelog

## 0.21.2

- ignore error on failed `git pull` during `gro deploy`
([#182](https://github.com/feltcoop/gro/pull/182))

## 0.21.1

- change `gro gen` to handle failed formatting gracefully
Expand Down
9 changes: 2 additions & 7 deletions src/deploy.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,8 @@ export const task: Task<TaskArgs> = {
try {
// Set up the deployment worktree in the dist directory.
await spawnProcess('git', ['worktree', 'add', WORKTREE_DIRNAME, DEPLOY_BRANCH]);
// Pull the remote deploy branch.
const gitPullResult = await spawnProcess('git', ['pull', ORIGIN, DEPLOY_BRANCH], GIT_ARGS);
if (!gitPullResult.ok) {
log.error(red(`failed git pull in deploy branch with exit code ${gitPullResult.code}`));
await cleanGitWorktree();
return;
}
// Pull the remote deploy branch, ignoring failures
await spawnProcess('git', ['pull', ORIGIN, DEPLOY_BRANCH], GIT_ARGS);
// Populate the worktree dir with the new files.
// We're doing this rather than copying the directory
// because we need to preserve the existing worktree directory, or git breaks.
Expand Down

0 comments on commit b61dcf9

Please sign in to comment.