Update file run_onchange_after_40-chrome.tmpl

This commit is contained in:
Brian Zalewski 2023-02-01 20:24:05 +00:00
parent 3b87939a86
commit 5304d32083

View file

@ -28,7 +28,7 @@ for EXTENSION_DIR in "/opt/google/chrome/extensions" "/etc/chromium/extensions"
### Ensure program-type is installed ### Ensure program-type is installed
if [ -d "$(dirname "$EXTENSION_DIR")" ]; then if [ -d "$(dirname "$EXTENSION_DIR")" ]; then
### Ensure extension directory exists ### Ensure extension directory exists
if [ "$EXTENSION_DIR" == '/opt/'* ] || [ "$EXTENSION_DIR" == '/etc/'* ]; then if [[ "$EXTENSION_DIR" == '/opt/'* ]] || [[ "$EXTENSION_DIR" == '/etc/'* ]]; then
if [ ! -d "$EXTENSION_DIR" ]; then if [ ! -d "$EXTENSION_DIR" ]; then
logg info "Creating directory $EXTENSION_DIR" logg info "Creating directory $EXTENSION_DIR"
sudo mkdir -p "$EXTENSION_DIR" sudo mkdir -p "$EXTENSION_DIR"
@ -45,7 +45,7 @@ for EXTENSION_DIR in "/opt/google/chrome/extensions" "/etc/chromium/extensions"
for EXTENSION in {{ list (.chromeExtensions | toString | replace "[" "" | replace "]" "") | uniq | join " " }}; do for EXTENSION in {{ list (.chromeExtensions | toString | replace "[" "" | replace "]" "") | uniq | join " " }}; do
logg info "Adding Chrome extension ($EXTENSION)" logg info "Adding Chrome extension ($EXTENSION)"
EXTENSION_ID="$(echo "$EXTENSION" | sed 's/^.*\/\([^\/]*\)$/\1/')" EXTENSION_ID="$(echo "$EXTENSION" | sed 's/^.*\/\([^\/]*\)$/\1/')"
if [ "$EXTENSION_DIR" == '/opt/'* ] || [ "$EXTENSION_DIR" == '/etc/'* ]; then if [[ "$EXTENSION_DIR" == '/opt/'* ]] || [[ "$EXTENSION_DIR" == '/etc/'* ]]; then
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/chrome/extension.json" "$EXTENSION_DIR/${EXTENSION_ID}.json" sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/chrome/extension.json" "$EXTENSION_DIR/${EXTENSION_ID}.json"
else else
cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/chrome/extension.json" "$EXTENSION_DIR/${EXTENSION_ID}.json" cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/chrome/extension.json" "$EXTENSION_DIR/${EXTENSION_ID}.json"