From 76cda09631c8c62ac6cc75c98138a699d9becced Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 2 Jul 2014 17:15:54 -0300 Subject: [PATCH] firefox WIP --- README.md | 11 ++++++++--- browser-extensions/chrome/build.sh | 2 +- browser-extensions/firefox/build.sh | 15 ++++++++++----- package.json | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 63f088f0d..682d4a447 100644 --- a/README.md +++ b/README.md @@ -146,12 +146,17 @@ else { ## Google Chrome Extension -When you need to compile a *Chrome Extension* of Copay, you only need to run: +To build Copay's *Chrome Extension*, run: ``` -$ sh chrome/build.sh +$ npm run-script chrome ``` -- The ZIP file is *chrome/copay-chrome-extension.zip* +- On sucess, the chrome extension is located at: +` + browser-extensions/chrome/copay-chrome-extension +` + +To install it go to `chrome://extensions/` at your chrome browser, make sure you have 'developer mode' option checked at your Chrome settings. Click on "Load unpacked chrome extension" and choose the directory mentioned above. ## Firefox Add-on diff --git a/browser-extensions/chrome/build.sh b/browser-extensions/chrome/build.sh index b6c438cac..0a49a99fa 100644 --- a/browser-extensions/chrome/build.sh +++ b/browser-extensions/chrome/build.sh @@ -47,7 +47,7 @@ checkOK INCLUDE=`cat ../include` cd $BUILDDIR/../.. LIBS=`cat index.html |grep -o -E 'src="([^"#]+)"' | cut -d'"' -f2|grep lib` -echo "LIBS $LIBS" +echo "LIBS: $LIBS" CMD="rsync -rLRv --exclude-from $BUILDDIR/../exclude $INCLUDE $LIBS $APPDIR" echo $CMD diff --git a/browser-extensions/firefox/build.sh b/browser-extensions/firefox/build.sh index 933722421..d9244ee9f 100644 --- a/browser-extensions/firefox/build.sh +++ b/browser-extensions/firefox/build.sh @@ -18,9 +18,9 @@ checkOK() { # Configs BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -APPDIR="$BUILDDIR/firefox-addon" +APPDIR="$BUILDDIR/browser-extensions/firefox/firefox-addon" ZIPFILE="copay-firefox-addon.zip" -VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js` +VERSION=`cut -d '"' -f2 $BUILDDIR/../../version.js` # Move to the build directory cd $BUILDDIR @@ -43,9 +43,14 @@ echo "${OpenColor}${Green}* Copying all firefox-addon files...${CloseColor}" sed "s/APP_VERSION/$VERSION/g" package.json > $APPDIR/package.json checkOK -cd $BUILDDIR/.. -cp -af {css,font,img,js,lib,sound,config.js,version.js,index.html,./popup.html} "$APPDIR/data" -cp -af "$BUILDDIR/lib" $APPDIR +INCLUDE=`cat ../../include` +cd $BUILDDIR/../.. +LIBS=`cat index.html |grep -o -E 'src="([^"#]+)"' | cut -d'"' -f2|grep lib` +echo "LIBS: $LIBS" + +CMD="rsync -rLRv --exclude-from $BUILDDIR/../exclude $INCLUDE $LIBS $APPDIR/data" +echo $CMD +$CMD checkOK echo "${OpenColor}${Yellow}\nAwesome! We have a brand new Firefox Addon, enjoy it!${CloseColor}" diff --git a/package.json b/package.json index 03b577f2d..486854d88 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "shell": "node shell/scripts/launch.js", "setup-shell": "node shell/scripts/download-atom-shell.js", "chrome": "source browser-extensions/chrome/build.sh" + "firefox": "source browser-extensions/firefox/build.sh" }, "homepage": "https://github.com/bitpay/copay", "devDependencies": {