bin: little script fixes

This commit is contained in:
xeruf 2021-05-05 08:56:44 +02:00
parent 4f9feb3d47
commit dcad94ba64
3 changed files with 8 additions and 8 deletions

View File

@ -4,11 +4,11 @@
# The regular command is "p status" to update all projects and show their status. # The regular command is "p status" to update all projects and show their status.
# Common root for all projects # Common root for all projects
projects_dir=${projects_dir:-$DATA/4-incubator/dev} projects_dir=${projects_dir:-$DATA/1-projects}
# The max depth to search for when listing projects. The actual depth is this value minus one, since it searches for ".git" folders at that depth.
projects_subfolder_level=4
# The max depth to search for when listing projects.
# The actual depth is this value minus one, since it searches for ".git" folders at that depth.
projects_subfolder_level=3
# Lists all projects under $projects_dir or the current directory if that is a subfolder of $projects_dir and not a git repository. # Lists all projects under $projects_dir or the current directory if that is a subfolder of $projects_dir and not a git repository.
# This is done by searching for corresponding ".git" folders and then listing their parent directories via "dirname" # This is done by searching for corresponding ".git" folders and then listing their parent directories via "dirname"

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
if git rev-parse @{u} 2>/dev/null >/dev/null if git rev-parse @{u} 2>/dev/null >/dev/null
then git push then git push "$@"
else git push --set-upstream else git push --set-upstream "$@"
fi fi

View File

@ -2,8 +2,8 @@
# Use grep and sed to replace $1 with $2 recursively and print what is done # Use grep and sed to replace $1 with $2 recursively and print what is done
grep --null --recursive --files-with-matches \ grep --null --recursive --files-with-matches \
--binary-files=without-match --exclude-dir={.sync,.stfolder,.git} "$1" | --binary-files=without-match --exclude-dir={.sync,.stfolder,.git} "$1" |
xargs -0 sed -i "/${1}/{ xargs -0 sed -i "\|${1}|{
s//${2}/g s||${2}|g
w /dev/stdout w /dev/stdout
}" }"