mirror of
https://github.com/lukasbestle/projectr.git
synced 2026-10-11 23:10:19 +02:00
site_unlink/project_remove: Only clear full match
`sed` has previously also removed lines that have only partly matched. Now, only full matches are removed.
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@ fi
|
||||
# Remove from the projects file
|
||||
echo -e "\033[1mRemoving project from \033[34m$projectsFile\033[0;1m...\033[0m"
|
||||
realpath="$(readlink -f "$project")"
|
||||
if ! sed -i "/${realpath//\//\/}/d" "$projectsFile"; then # Replace / with \/ because of the sed separators
|
||||
if ! sed -i "/^${realpath//\//\/}$/d" "$projectsFile"; then # Replace / with \/ because of the sed separators
|
||||
echo -e " => \033[31mSomething went wrong.\033[0m" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user