Last active
February 19, 2022 10:06
-
-
Save ikskuh/8c71e794a654b41f07510af96992dba7 to your computer and use it in GitHub Desktop.
Revisions
-
ikskuh revised this gist
Feb 19, 2022 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ PACKAGE_LIBRARY="/home/felix/software/zig-packages.json" set -e if ! which jq git > /dev/null ; then echo "Not all required tools are installed!" >&2 exit 1 fi @@ -59,4 +59,3 @@ cd "${ROOT}/vendor" git submodule add "${PACKAGE_REPO}" "${PACKAGE}" git submodule update --init --recursive cd "${ROOT}" -
ikskuh created this gist
Feb 19, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ { "ihex": { "git": "https://github.com/MasterQ32/zig-ihex" }, "args": { "git": "https://github.com/MasterQ32/zig-args" }, "parser-toolkit": { "git": "https://github.com/MasterQ32/parser-toolkit" }, "serial": { "git": "https://github.com/MasterQ32/zig-serial" } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ #!/bin/bash ### CONFIG ### PACKAGE_LIBRARY="/home/felix/software/zig-packages.json" ### CODE STARTS HERE ### set -e if ! which jq git git-patch-configs > /dev/null ; then echo "Not all required tools are installed!" >&2 exit 1 fi PACKAGE="$1" if [ -z "${PACKAGE}" ]; then echo "missing package name!" >&2 exit 1 fi if [ "$(jq "has(\"${PACKAGE}\")" "${PACKAGE_LIBRARY}")" != "true" ]; then echo "package ${PACKAGE} does not exist!" >&2 echo "add ${PACKAGE} to ${PACKAGE_LIBRARY} in order to install it." >&2 exit 1 fi ROOT="$(git rev-parse --show-superproject-working-tree)" if [ -z "${ROOT}" ]; then ROOT="$(git rev-parse --show-toplevel)" fi if [ ! -d "${ROOT}/.git" ]; then echo "not in a git repository!" >&2 exit 1 fi # if [ ! -f "${ROOT}/.gitmodules" ]; then # echo "submodules not initialized!" >&2 # exit 1 # fi if [ ! -d "${ROOT}/vendor" ]; then echo "no vendor subfolder!" >&2 exit 1 fi if [ -d "${ROOT}/vendor/${PACKAGE}" ]; then echo "package ${PACKAGE} is already installed!" >&2 exit 1 fi PACKAGE_REPO="$(jq --raw-output ".\"${PACKAGE}\".git" "${PACKAGE_LIBRARY}")" cd "${ROOT}/vendor" git submodule add "${PACKAGE_REPO}" "${PACKAGE}" git submodule update --init --recursive cd "${ROOT}" git-patch-configs