🏡 index : github.com/captn3m0/which-electron.git

author Nemo <commits@captnemo.in> 2022-02-02 18:47:50.0 +05:30:00
committer Nemo <commits@captnemo.in> 2022-02-02 18:47:50.0 +05:30:00
commit
1931e40778d1b01fabe7ec557ae1ba0e1963b763 [patch]
tree
0df1cdca418ee4ad5f3ea2e27c3e4bc6e111ca8e
parent
351250d2a35614e84243c4ef793c6398286815d6
download
1931e40778d1b01fabe7ec557ae1ba0e1963b763.tar.gz

faster version fetch script



Diff

 _scripts/gen_versions.php | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/_scripts/gen_versions.php b/_scripts/gen_versions.php
index 7e719f0..5c97eb9 100644
--- a/_scripts/gen_versions.php
+++ a/_scripts/gen_versions.php
@@ -5,13 +5,12 @@
// till May 2022, after which only 3 major versions will be supported
const SUPPORTED_MAJOR_VERSIONS = [14, 15, 16, 17];

// Command to fetch the list of versions from upstream
const FETCH_VERSIONS_COMMAND = "git ls-remote -q --tags https://github.com/electron/electron.git |grep -v '\^{}' |cut -f2 | sed -s 's/refs\/tags\///g' ";
function get_versions() {
    `rm -rf electron-src`;
    `git clone https://github.com/electron/electron.git electron-src`;
    chdir("electron-src");

    $versions = [];
    foreach(explode("\n", shell_exec("git tag -l")) as $version) {
    foreach(explode("\n", shell_exec(FETCH_VERSIONS_COMMAND)) as $version) {
        foreach(VERSION_EXCLUDE as $needle) {
            if (stripos($version, $needle) !== false) {
                continue 2;
@@ -24,9 +23,6 @@

        $versions[] = $version;
    }

    chdir("..");
    `rm -rf electron-src`;

    return $versions;
}