Skip to content

Instantly share code, notes, and snippets.

@jmblog
Last active November 7, 2016 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmblog/96bc309d06228c8373c6965208832775 to your computer and use it in GitHub Desktop.
Save jmblog/96bc309d06228c8373c6965208832775 to your computer and use it in GitHub Desktop.
CI のビルド時に patch を適用する際の注意点 ref: http://qiita.com/jimbo/items/1643523195b03f53e860
# 1回目
$ patch --batch -p0 -i xxx.patch
patching file node_modules/foo/bar/xxx
# 2回目
$ patch --batch -p0 -i xxx.patch
patching file node_modules/foo/bar/xxx
Reversed (or previously applied) patch detected! Assuming -R. # 元に戻ってしまう
$ patch --batch -N -p0 -i xxx.patch
patching file node_modules/foo/bar/xxx
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file node_modules/foo/bar/xxx.rej
#!/bin/bash
PATCH_CMD="patch --batch --silent -p0 -N -i xxx.patch"
if ${PATCH_CMD} --dry-run; then
${PATCH_CMD}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment