From 7a646a30d16e7ea236db00152c98517209092706 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 21 Jan 2024 18:52:16 +0800 Subject: [PATCH] Restructure mister scripts --- .gitignore | 2 +- magefile.go | 4 ++-- scripts/{misterbuild => mister/build}/Dockerfile | 0 scripts/{misterbuild => mister/build}/libnfc.sh | 0 .../build}/patches/acr122u-fix.patch | 0 scripts/{generate_repo.py => mister/repo/generate.py} | 7 ++++--- 6 files changed, 7 insertions(+), 6 deletions(-) rename scripts/{misterbuild => mister/build}/Dockerfile (100%) rename scripts/{misterbuild => mister/build}/libnfc.sh (100%) rename scripts/{misterbuild => mister/build}/patches/acr122u-fix.patch (100%) rename scripts/{generate_repo.py => mister/repo/generate.py} (91%) diff --git a/.gitignore b/.gitignore index 7808e8f0..7efff53a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,5 @@ go.work /bin /_bin /out -scripts/misterbuild/_build +scripts/mister/build/_build .DS_Store diff --git a/magefile.go b/magefile.go index 9c67a7d8..b03887c4 100644 --- a/magefile.go +++ b/magefile.go @@ -39,8 +39,8 @@ var ( binReleasesDir = filepath.Join(binDir, "releases") upxBin = os.Getenv("UPX_BIN") // docker mister arm build - misterBuild = filepath.Join(cwd, "scripts", "misterbuild") - misterBuildImageName = "tapto/misterbuild" + misterBuild = filepath.Join(cwd, "scripts", "mister", "build") + misterBuildImageName = "tapto/mister-build" misterBuildCache = filepath.Join(os.TempDir(), "tapto-mister-buildcache") misterModCache = filepath.Join(os.TempDir(), "tapto-mister-modcache") ) diff --git a/scripts/misterbuild/Dockerfile b/scripts/mister/build/Dockerfile similarity index 100% rename from scripts/misterbuild/Dockerfile rename to scripts/mister/build/Dockerfile diff --git a/scripts/misterbuild/libnfc.sh b/scripts/mister/build/libnfc.sh similarity index 100% rename from scripts/misterbuild/libnfc.sh rename to scripts/mister/build/libnfc.sh diff --git a/scripts/misterbuild/patches/acr122u-fix.patch b/scripts/mister/build/patches/acr122u-fix.patch similarity index 100% rename from scripts/misterbuild/patches/acr122u-fix.patch rename to scripts/mister/build/patches/acr122u-fix.patch diff --git a/scripts/generate_repo.py b/scripts/mister/repo/generate.py similarity index 91% rename from scripts/generate_repo.py rename to scripts/mister/repo/generate.py index 45fb1db8..526defff 100644 --- a/scripts/generate_repo.py +++ b/scripts/mister/repo/generate.py @@ -11,7 +11,8 @@ DB_ID = "mrext/tapto" DL_URL = "https://github.com/wizzomafizzo/tapto/releases/download/{}" -DL_FOLDER = "_bin/releases" +RELEASES_FOLDER = "_bin/releases" +REPO_FOLDER = "scripts/mister/repo" FILES = [ "tapto.sh", "taptui.sh", @@ -52,7 +53,7 @@ def create_tapto_db(tag: str) -> RepoDb: files: RepoDbFiles = {} for file in FILES: - local_path = os.path.join(DL_FOLDER, file) + local_path = os.path.join(RELEASES_FOLDER, file) key = "Scripts/{}".format(os.path.basename(local_path)) size = os.stat(local_path).st_size @@ -89,7 +90,7 @@ def main(): tag = sys.argv[1] repo_db = create_tapto_db(tag) - with open("{}/tapto.json".format(DL_FOLDER), "w") as f: + with open("{}/tapto.json".format(REPO_FOLDER), "w") as f: f.write(generate_json(repo_db)) if __name__ == "__main__":