From fae912f5632d576461eca01541a7600cd7cfafcf Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Veyry Date: Thu, 22 Aug 2019 16:02:29 +0100 Subject: [PATCH] repo: add ghc colorscheme --- .travis.yml | 12 ++++++++++-- generate_patch.sh | 6 ++++-- js/plugin.js | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0280e6..d61b351 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,20 @@ before_script: script: - ./generate_patch.sh t/Chat.app/Contents/Resources/electron.asar +after_script: + - 7z a -tzip out/electron-slack.zip out/slacktheme/electron.asar + - 7z a -tzip out/electron-ghc.zip out/ghctheme/electron.asar + - cp out/slacktheme/gmonkeyscript.js out/gmonkeyscript-slack.js + - cp out/ghctheme/gmonkeyscript.js out/gmonkeyscript-ghc.js + deploy: provider: releases api_key: $TOKEN file: - - "out/slacktheme/electron.asar" - - "out/slacktheme/gmonkeyscript.js" + - "out/electron-ghc.zip" + - "out/electron-slack.zip" + - "out/gmonkeyscript-ghc.js" + - "out/gmonkeyscript-slack.js" skip-cleanup: true on: tags: true diff --git a/generate_patch.sh b/generate_patch.sh index 8edfdce..25a29c9 100755 --- a/generate_patch.sh +++ b/generate_patch.sh @@ -12,11 +12,10 @@ ASARFILE="$1" [ -z "$ASARFILE" ] || asar e "$ASARFILE" "$DIR" -mkdir -p out/slacktheme - [ -z "$ASARFILE" ] || cp "$DIR/renderer/init.js" $DEFAULTINIT generateFiles() { + mkdir -p "$3" cat js/plugin.js \ | sed "s/CSSSHAPEURL/$1/g" \ | sed "s/CSSCOLORURL/$2/g" \ @@ -32,4 +31,7 @@ generateFiles() { generateFiles "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/shape.css" "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/color_slack.css" "out/slacktheme" +generateFiles "https:\/\/raw.githubusercontent.com\/paveyry\/better-hangoutschat\/master\/css\/shape.css" "" "out/ghctheme" + + rm -rf "$DIR" "$DEFAULTINIT" "$PLUGINGEN" "$PLUGINGEN2" diff --git a/js/plugin.js b/js/plugin.js index 12e8564..1d393f2 100644 --- a/js/plugin.js +++ b/js/plugin.js @@ -29,6 +29,9 @@ insertionQ('.cZICLc').every(linkFunction); let webviews = document.querySelectorAll("webview"); function loadCSS(cssPath) { + if (cssPath == '') { + return; + } // Fetch our CSS in parallel ahead of time let cssPromise = fetch(cssPath).then(response => response.text());