generated from stubbfel/nix-project-template
update
This commit is contained in:
@@ -11,9 +11,6 @@ usage() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Default values
|
||||
dry_run=false
|
||||
|
||||
# Parse command-line options
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
@@ -52,6 +49,11 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
# Apply default values if required
|
||||
if [ -z "$dry_run" ]; then
|
||||
dry_run=false
|
||||
fi
|
||||
|
||||
if [ -z "$target_file" ]; then
|
||||
target_file="${MSMAP_TARGET_ROOT}/usr/bin/manjaro-sway-mirrors"
|
||||
fi
|
||||
@@ -66,7 +68,7 @@ if [ -z "$replace_pattern" ]; then
|
||||
replace_pattern='\$(pacman-mirrors -G \| sed \"s/^arm-//\")'
|
||||
fi
|
||||
|
||||
sed_command="sed -i \"s|${search_pattern}|${replace_pattern}|g\" \"${target_file}\""
|
||||
sed_command="sed -i 's|${search_pattern}|${replace_pattern}|g' '${target_file}'"
|
||||
# Perform the sed command
|
||||
if $dry_run; then
|
||||
echo "$sed_command"
|
||||
|
||||
Reference in New Issue
Block a user