From eecd43097c520a686c4b1895990b6feebc7643b5 Mon Sep 17 00:00:00 2001 From: Maxim Pertsov Date: Mon, 14 Oct 2024 21:46:08 -0400 Subject: [PATCH] add first_run directive and script --- Makefile | 2 +- first_run.sh | 9 +++++++++ meta.json | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 first_run.sh diff --git a/Makefile b/Makefile index c35a43b..eb6da0f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ wifi: *.go */*.go go.* go build -o $@ -ldflags "-s -w" -tags osusergo,netgo file $@ -module.tar.gz: wifi +module.tar.gz: wifi first_run.sh # the bundled module rm -f $@ tar czf $@ $^ diff --git a/first_run.sh b/first_run.sh new file mode 100644 index 0000000..95ece21 --- /dev/null +++ b/first_run.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [[ -n "$VIAM_TEST_FAIL_RUN_FIRST" ]]; then + exit 1 +fi + +echo "first_run script ran successfully" + +exit 0 diff --git a/meta.json b/meta.json index 2a87477..092072b 100644 --- a/meta.json +++ b/meta.json @@ -15,5 +15,6 @@ "arch" : ["linux/amd64", "linux/arm64", "darwin/arm64"], "darwin_deps": ["go"] }, - "entrypoint": "wifi" + "entrypoint": "wifi", + "first_run": "first_run.sh" }