Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2462)

Unified Diff: chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh

Issue 824783004: Fix string escaping in (un)install scripts of native messaging example (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/docs/examples/api/nativeMessaging/host/uninstall_host.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh
diff --git a/chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh b/chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh
index 48b03147263d2ffacbb0aa5410610581d513727f..dc9f22543f2ef03ada861ba44861ce1bf178c146 100755
--- a/chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh
+++ b/chrome/common/extensions/docs/examples/api/nativeMessaging/host/install_host.sh
@@ -6,12 +6,11 @@
set -e
DIR="$( cd "$( dirname "$0" )" && pwd )"
-if [ $(uname -s) == 'Darwin' ]; then
+if [ "$(uname -s)" == "Darwin" ]; then
if [ "$(whoami)" == "root" ]; then
TARGET_DIR="/Library/Google/Chrome/NativeMessagingHosts"
else
- TARGET_DIR=\
- "$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts"
+ TARGET_DIR="$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts"
fi
else
if [ "$(whoami)" == "root" ]; then
@@ -24,17 +23,17 @@ fi
HOST_NAME=com.google.chrome.example.echo
# Create directory to store native messaging host.
-mkdir -p $TARGET_DIR
+mkdir -p "$TARGET_DIR"
Sergey Ulanov 2015/01/06 17:29:59 Some of these changes were already landed in https
# Copy native messaging host manifest.
-cp $DIR/$HOST_NAME.json $TARGET_DIR
+cp "$DIR/$HOST_NAME.json" "$TARGET_DIR"
# Update host path in the manifest.
HOST_PATH=$DIR/native-messaging-example-host
ESCAPED_HOST_PATH=${HOST_PATH////\\/}
-sed -i -e "s/HOST_PATH/$ESCAPED_HOST_PATH/" $TARGET_DIR/$HOST_NAME.json
+sed -i -e "s/HOST_PATH/$ESCAPED_HOST_PATH/" "$TARGET_DIR/$HOST_NAME.json"
# Set permissions for the manifest so that all users can read it.
-chmod o+r $TARGET_DIR/$HOST_NAME.json
+chmod o+r "$TARGET_DIR/$HOST_NAME.json"
-echo Native messaging host $HOST_NAME has been installed.
+echo "Native messaging host $HOST_NAME has been installed."
« no previous file with comments | « no previous file | chrome/common/extensions/docs/examples/api/nativeMessaging/host/uninstall_host.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698