bin: little script fixes
This commit is contained in:
parent
4f9feb3d47
commit
dcad94ba64
|
@ -4,11 +4,11 @@
|
|||
# The regular command is "p status" to update all projects and show their status.
|
||||
|
||||
# Common root for all projects
|
||||
projects_dir=${projects_dir:-$DATA/4-incubator/dev}
|
||||
|
||||
# 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
|
||||
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=3
|
||||
|
||||
# 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"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
if git rev-parse @{u} 2>/dev/null >/dev/null
|
||||
then git push
|
||||
else git push --set-upstream
|
||||
then git push "$@"
|
||||
else git push --set-upstream "$@"
|
||||
fi
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Use grep and sed to replace $1 with $2 recursively and print what is done
|
||||
grep --null --recursive --files-with-matches \
|
||||
--binary-files=without-match --exclude-dir={.sync,.stfolder,.git} "$1" |
|
||||
xargs -0 sed -i "/${1}/{
|
||||
s//${2}/g
|
||||
xargs -0 sed -i "\|${1}|{
|
||||
s||${2}|g
|
||||
w /dev/stdout
|
||||
}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue