-
Notifications
You must be signed in to change notification settings - Fork 5
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
delete other filesの処理を修正 #47
Conversation
for file in ${delete_files[@]}; do | ||
rm "$file" | ||
done | ||
|
||
restore_files=($(grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}" $(git ls-files -m --exclude-standard))) | ||
for file in ${resotre_files[@]}; do | ||
restore_files=(git ls-files -m --exclude-standard | xargs -r grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[must]$
が抜けてそうでした.
restore_files=(git ls-files -m --exclude-standard | xargs -r grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}") | |
restore_files=$(git ls-files -m --exclude-standard | xargs -r grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}") |
@@ -29,13 +29,14 @@ runs: | |||
shell: bash | |||
- name: delete other files | |||
run: | | |||
delete_files=($(grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}" $(git ls-files -o --exclude-standard))) | |||
set +eo pipefail | |||
delete_files=$(git ls-files -o --exclude-standard | xargs -r grep -xL "EditURL: ${{ steps.set-entry-variables.outputs.EDIT_URL }}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[should]restore_files の方もですが, ()
で括っていないので配列じゃなくなっていそうです.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど……
レビューありがとうございます。2箇所とも治したほうが良さそうだったので治しました |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良さそうです~
dmdm~ |
#45 の修正が不完全だったので追い修正です
grep -xL "EditURL" $(git ls-files)
形式だと、git ls-files
の結果がなかったときgrepがstdinから読もうとしてしまいそうなのでxargs -r
を利用するように(-r
は--no-run-if-empty
の短縮形)-e
と-o pipefail
をなしに