-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making templates and build them instead of having fixed variables (re…
…fres #3)
- Loading branch information
1 parent
7795d9e
commit a3b8992
Showing
7 changed files
with
67 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.pyc | ||
app/goopg-web-extension-id.js | ||
app/lib/css/goopg-bootstrap.css | ||
app/lib/fonts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
# Copyright 2013 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "usage: ${0##*/} extension_id [chromium|google-chrome]" | ||
exit 1 | ||
} | ||
|
||
EXT_ID=$1 | ||
BROWSER=$2 | ||
|
||
DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
|
||
if [ "$BROWSER" == "" ] ; then | ||
BROWSER="chromium" | ||
fi | ||
|
||
if [ "$BROWSER" != "chromium" -a "$BROWSER" != "google-chrome" ] ; then | ||
usage | ||
fi | ||
|
||
if [ "$EXT_ID" == "" ]; then | ||
usage | ||
fi | ||
|
||
if [ "$TARGET_DIR" == "" ] ; then | ||
TARGET_DIR="$HOME/.config/$BROWSER/NativeMessagingHosts" | ||
fi | ||
|
||
if [ "$HOST_PATH" == "" ] ; then | ||
HOST_PATH=`realpath "$DIR/../host"` | ||
fi | ||
|
||
# Create directory to store native messaging host. | ||
mkdir -p $TARGET_DIR | ||
|
||
# Copy native messaging host manifest. | ||
JSON="com.leoiannacone.goopg.json" | ||
cp "$DIR/$JSON.in" "$TARGET_DIR/$JSON" | ||
|
||
# Update host path in the manifest. | ||
HOST_PATH="$HOST_PATH/chrome-main.py" | ||
sed -i "s|@HOST_PATH@|$HOST_PATH|" "$TARGET_DIR/$JSON" | ||
sed -i "s|@EXT_ID@|$EXT_ID|" "$TARGET_DIR/$JSON" | ||
|
||
# Set permissions for the manifest so that all users can read it. | ||
chmod o+r "$TARGET_DIR/$JSON" | ||
|
||
echo Native messaging host $JSON has been installed. $TARGET_DIR/$JSON | ||
|
||
# make the goopg-web-extension-id | ||
JS=goopg-web-extension-id.js | ||
sed "s|@EXT_ID@|$EXT_ID|" "$DIR/$JS.in" > "$DIR/../app/$JS" |
4 changes: 2 additions & 2 deletions
4
host/com.leoiannacone.goopg.json → templates/com.leoiannacone.goopg.json.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "com.leoiannacone.goopg", | ||
"description": "GPG wrapper", | ||
"path": "HOST_PATH", | ||
"path": "@HOST_PATH@", | ||
"type": "stdio", | ||
"allowed_origins": [ | ||
"chrome-extension://ppopiamobkilibbniemlecehjmbfbjjp/" | ||
"chrome-extension://@EXT_ID@/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters