Last active
November 7, 2016 00:46
-
-
Save jmblog/96bc309d06228c8373c6965208832775 to your computer and use it in GitHub Desktop.
CI のビルド時に patch を適用する際の注意点 ref: http://qiita.com/jimbo/items/1643523195b03f53e860
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. # 元に戻ってしまう |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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