Skip to content

Commit b4046ba

Browse files
authored
check if file exist before read (#21)
Signed-off-by: Greg Osuri <me@gregosuri.com>
1 parent 337d0c3 commit b4046ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

layer0/packet/make.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
PACKET_API_TOKEN ?= $(shell cat $(DBKEY)/packet.api.token)
2-
PACKET_PROJECT_ID ?= $(shell cat $(DBKEY)/packet.project.id)
3-
CLOUDFLARE_API_TOKEN ?= $(shell cat $(DBKEY)/cloudflare.api.token)
1+
PACKET_API_TOKEN ?= $(shell [ -f $(DBKEY)/packet.api.token ] && cat $(DBKEY)/packet.api.token)
2+
PACKET_PROJECT_ID ?= $(shell [ -f $(DBKEY)/packet.project.id ] && cat $(DBKEY)/packet.project.id)
3+
CLOUDFLARE_API_TOKEN ?= $(shell [ -f $(DBKEY)/cloudflare.api.token ] && cat $(DBKEY)/cloudflare.api.token)
44

55
tfopts := -state '$(tfstatefs)' \
66
-var 'packet_api_token=$(PACKET_API_TOKEN)' \

0 commit comments

Comments
 (0)