From c8185050f61261c6a85a59f6bb9d695e4baefd85 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Sat, 16 Jan 2021 18:40:18 +0530 Subject: [PATCH] feat: GitHub buttons --- build.js | 56 ------------------------------ components/collections/index.vue | 2 +- components/environments/index.vue | 2 +- components/firebase/feeds.vue | 2 +- components/layout/history.vue | 2 +- components/layout/pw-footer.vue | 57 +++++++------------------------ components/layout/pw-header.vue | 10 ++++++ components/ui/tabs.vue | 1 + package.json | 3 -- 9 files changed, 28 insertions(+), 107 deletions(-) delete mode 100644 build.js diff --git a/build.js b/build.js deleted file mode 100644 index 25b4acacd..000000000 --- a/build.js +++ /dev/null @@ -1,56 +0,0 @@ -const axios = require("axios") -const fs = require("fs") -const { spawnSync } = require("child_process") -const runCommand = (command, args) => spawnSync(command, args).stdout.toString().replace(/\n/g, "") - -const FAIL_ON_ERROR = false -const PW_BUILD_DATA_DIR = "./.hoppscotch" -// const IS_DEV_MODE = process.argv.includes("--dev") - -try { - (async () => { - // Create the build data directory if it does not exist. - if (!fs.existsSync(PW_BUILD_DATA_DIR)) { - fs.mkdirSync(PW_BUILD_DATA_DIR) - } - - let version = {} - // Get the current version name as the tag from Git. - version.name = - process.env.TRAVIS_TAG || runCommand("git", ["tag --sort=committerdate | tail -1"]) - - // FALLBACK: If version.name was unset, let's grab it from GitHub. - if (!version.name) { - version.name = ( - await axios - .get("https://api.github.com/repos/hoppscotch/hoppscotch/releases") - // If we can't get it from GitHub, we'll resort to getting it from package.json - .catch((ex) => ({ - data: [ - { - tag_name: require("./package.json").version, - }, - ], - })) - ).data[0]["tag_name"] - } - - // Get the current version hash as the short hash from Git. - // version.hash = runCommand("git", ["rev-parse", "--short", "HEAD"]) - // Get the 'variant' name as the branch, if it's not master. - // version.variant = - // process.env.TRAVIS_BRANCH || - // runCommand("git", ["branch"]) - // .split("* ")[1] - // .split(" ")[0] + (IS_DEV_MODE ? " - DEV MODE" : "") - // if (["", "master"].includes(version.variant)) { - // delete version.variant - // } - - // Write version data into a file - fs.writeFileSync(`${PW_BUILD_DATA_DIR}/version.json`, JSON.stringify(version)) - })() -} catch (ex) { - console.error(ex) - process.exit(FAIL_ON_ERROR ? 1 : 0) -} diff --git a/components/collections/index.vue b/components/collections/index.vue index 032534bbc..d309c55b0 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -81,7 +81,7 @@ diff --git a/components/environments/index.vue b/components/environments/index.vue index 5c2dc30a5..d67522b3d 100644 --- a/components/environments/index.vue +++ b/components/environments/index.vue @@ -60,7 +60,7 @@ diff --git a/components/firebase/feeds.vue b/components/firebase/feeds.vue index 6d90f2e9e..e3acbe84c 100644 --- a/components/firebase/feeds.vue +++ b/components/firebase/feeds.vue @@ -30,7 +30,7 @@