From 2f07595182d852856d311dae10e9edb3d7d69d6f Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Sat, 28 Apr 2018 18:01:44 +0100 Subject: [PATCH] Fix native messenger breaking on OSX on update --- native/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/native/install.sh b/native/install.sh index 2ca74441..a8e46e39 100755 --- a/native/install.sh +++ b/native/install.sh @@ -19,7 +19,8 @@ fi mkdir -p "$manifest_home" "$XDG_DATA_HOME" manifest_file="$manifest_home/tridactyl.json" -native_file="$XDG_DATA_HOME/native_main.py" +native_file="$XDG_DATA_HOME/native_main.py.new" +native_file_final="$XDG_DATA_HOME/native_main.py" echo "Installing manifest here: $manifest_home" echo "Installing script here: XDG_DATA_HOME: $XDG_DATA_HOME" @@ -34,7 +35,7 @@ else curl -sS --create-dirs -o "$native_file" "$native_loc" fi -native_file_escaped=$(sed 's/[&/\]/\\&/g' <<< "$native_file") +native_file_escaped=$(sed 's/[&/\]/\\&/g' <<< "$native_file_final") sed -i.bak "s/REPLACE_ME_WITH_SED/$native_file_escaped/" "$manifest_file" chmod +x $native_file @@ -45,6 +46,7 @@ pip_path=$(which pip3) python_file_escaped=$(sed 's/[&/\]/\\&/g' <<< "$python_path") if [[ -x "$python_path" ]] && [[ -x "$pip_path" ]]; then sed -i.bak "1s/.*/#!$python_file_escaped/" "$native_file" + mv "$native_file" "$native_file_final" # pip3 install --user tinycss2 # put dependencies here else