gaztec 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/aztec-nargo.sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ source "$(dirname -- "${BASH_SOURCE[0]}")/install-aztec.sh"
5
+
6
+ $AZTEC_NARGO $@
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ source "$(dirname -- "${BASH_SOURCE[0]}")/install-aztec.sh"
5
+
6
+ $AZTEC_POSTPROCESS_CONTRACT $@
package/aztec.sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ source "$(dirname -- "${BASH_SOURCE[0]}")/install-aztec.sh"
5
+
6
+ $AZTEC $@
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ install_aztec() {
5
+ local version=$1
6
+
7
+ local aztec_path="$HOME/.aztec/v$version/bin"
8
+
9
+ if [[ ! -f "$aztec_path/aztec" ]]; then
10
+ echo "Installing aztec $version in $aztec_path"
11
+ VERSION=$version BIN_PATH=$aztec_path NON_INTERACTIVE=1 bash -i <(curl -s https://install.aztec.network)
12
+ fi
13
+ }
14
+
15
+ # go from the current dir to the root of the filesystem and find the first .gaztecrc file
16
+ dir=$(pwd)
17
+ while [[ $dir != "/" ]]; do
18
+ if [[ -f "$dir/.gaztecrc" ]]; then
19
+ AZTEC_VERSION=$(cat $dir/.gaztecrc | tr -d '\n')
20
+ break
21
+ fi
22
+ dir=$(dirname $dir)
23
+ done
24
+ if [[ -z "$AZTEC_VERSION" ]]; then
25
+ echo "No .gaztecrc file found in the current or parent directories starting from $(pwd)"
26
+ exit 1
27
+ fi
28
+
29
+
30
+ install_aztec $AZTEC_VERSION
31
+
32
+ AZTEC="$HOME/.aztec/v$AZTEC_VERSION/bin/aztec"
33
+ AZTEC_NARGO="$HOME/.aztec/v$AZTEC_VERSION/bin/aztec-nargo"
34
+ AZTEC_POSTPROCESS_CONTRACT="$HOME/.aztec/v$AZTEC_VERSION/bin/aztec-postprocess-contract"
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "gaztec",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "description": "Aztec version manager",
6
+ "bin": {
7
+ "gaztec": "./aztec.sh",
8
+ "gaztec-nargo": "./aztec-nargo.sh",
9
+ "gaztec-postprocess-contract": "./aztec-postprocess-contract.sh"
10
+ }
11
+ }