Add proper comment indicators before the warning

This commit is contained in:
Kipras Melnikovas 2019-03-28 16:28:43 +02:00 committed by GitHub
parent 9eb5d55866
commit 8f0ffd1153
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,13 +6,14 @@ qute_shortcuts="/dev/null"
fish_shortcuts="/dev/null"
vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts"
filename="$(basename "$0")"
file_override_warning="# Warning! This file is automatically formatted & overridden by \"$(pwd)/$filename\" script"
# note - do not forget to add a comment indicator ('#' or '"' or '//' etc.) before this string
file_override_warning="Warning! This file is automatically formatted & overridden by \"$(pwd)/$filename\" script"
# Remove, prepare files
rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null
printf "# vim: filetype=sh\\n$file_override_warning\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\n$file_override_warning\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n$file_override_warning\\n" > "$vifm_shortcuts"
printf "# vim: filetype=sh\\n# $file_override_warning\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\n# $file_override_warning\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n\" $file_override_warning\\n" > "$vifm_shortcuts"
# Format the `bmdirs` file in the correct syntax and sent it to all three configs.
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \