heisencoder / keyfixer

Firefox Extension for changing the Mac keybindings to behave like Windows/Linux
http://mavaball.net/wiki/Keyfixer
0 stars 0 forks source link

Small fixed to build.sh #3

Closed tadgy closed 9 years ago

tadgy commented 9 years ago

Hey, New day.. fresh pair of eyes. I noticed a couple of issues with my additions to build.sh - you spotted one with the chrome.manifest'' file that shouldn't have been there.

Anyhow, corrected that issue, and also re-enabled the cleanup that I forgot to do when testing. These changes don't affect the .xpi - it's all build cosmetics. Patch is below - a git diff this time :)

FYI, my patch from the other day /was/ needed to correct some of the issues with the altered chrome.manifest - the original sed seemed to insert the package name in the wrong places. The fix will work for any package name now also - it will modify the chome.manifest accordngly :)

Glad we got this fixed - I can't stand Apple's idea about what some keys should actually do...

Darren.

diff --git a/source/build.sh b/source/build.sh
index cd3e583..28764dd 100755
--- a/source/build.sh
+++ b/source/build.sh
@@ -113,14 +113,11 @@ if [ -f "chrome.manifest" ]; then
 #  sed -E -e "s/^(content\\s+\\S*\\s+)(\\S*\\/)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/g" chrome.manifest
 #  sed -E -e "s/^(skin\|locale)(\\s+\\S*\\s+\\S*\\s+)(.*\\/)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/g" chrome.manifest
 # Note from Darren: This should work on GNU sed as well as BSD sed.
-  SED_ARGS="-r -i"
-  [[ "$(uname -s)" =~ (Darwin|.*BSD) ]] && SED_ARGS="-E -i ''"
-  sed $SED_ARGS "s/^([[:space:]]*content[[:space:]]+)[^[:space:]]+([[:space:]]+jar:chrome\/)[^\.]+(\.jar.*)/\1${APP_NAME}\2${APP_NAME}\3/" chrome.manifest
-  sed $SED_ARGS "s/^([[:space:]]*override[[:space:]]+[^[:space:]]+[[:space:]]+chrome:\/\/)[^\/]+(\/.*)/\1${APP_NAME}\2/g" chrome.manifest
+  SED_ARGS=("-r" "-i")
+  [[ "$(uname -s)" =~ (Darwin|.*BSD) ]] && SED_ARGS=("-E" "-i" "''")
+  sed "${SED_ARGS[@]}" "s/^([[:space:]]*content[[:space:]]+)[^[:space:]]+([[:space:]]+jar:chrome\/)[^\.]+(\.jar.*)/\1${APP_NAME}\2${APP_NAME}\3/" chrome.manifest
+  sed "${SED_ARGS[@]}" "s/^([[:space:]]*override[[:space:]]+[^[:space:]]+[[:space:]]+chrome:\/\/)[^\/]+(\/.*)/\1${APP_NAME}\2/g" chrome.manifest
   # I didn't re-write the (skin|locale) regex as it wasn't used in the chrome.manifest file.  Should be easy enough to figure it out though :)
-  if [ -e "chrome.manifest''" ]; then
-    rm "chrome.manifest''"
-  fi
 fi

 # generate the XPI file
@@ -138,7 +135,7 @@ else
 fi

 # remove the working files
-#rm -rf $TMP_DIR
+rm -rf $TMP_DIR
 echo "Done!"

 $AFTER_BUILD
heisencoder commented 9 years ago

Thanks for the fix, tadgy! I've applied the patch and have pushed the change.

If you find it easier, you can also hand-off these diffs as "Pull Requests", but I also happy to take conventional diffs as well.

Cheers, -Matt