File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ ARCHIVE_DIR=$(echo "${QUERY}" | jq -r '.archive_dir')
11
11
FILE_NAME=$( echo " ${QUERY} " | jq -r ' .file_name' )
12
12
LABEL=$( echo " ${QUERY} " | jq -r ' .label' )
13
13
STARTUP_SCRIPT=$( echo " ${QUERY} " | jq -r ' .startup_script' )
14
+ DOTENV=$( echo " ${QUERY} " | jq -r ' .dotenv' )
14
15
NEEDROOT=$( echo " ${QUERY} " | jq -r ' .needroot' )
15
16
if [ " ${NEEDROOT} " = " true" ]; then
16
17
NEEDROOT=" --needroot"
@@ -27,8 +28,11 @@ cp -R "${ARCHIVE_DIR}" .
27
28
cp " ${MAKESELF_BIN} " makeself.sh
28
29
cp " ${MAKESELF_HEADER_BIN} " makeself-header.sh
29
30
chmod +x " $( basename " ${ARCHIVE_DIR} " ) /${STARTUP_SCRIPT} "
31
+ if [ -n " ${DOTENV} " ]; then
32
+ echo " ${DOTENV} " > " $( basename " ${ARCHIVE_DIR} " ) /.env"
33
+ fi
30
34
31
- RUN=( ./makeself.sh --nomd5 --nocrc --tar-extra ' --mtime=2019-01-01' --packaging-date ' 1970-01-01T00:00:00Z' --base64 " ${NEEDROOT} " " $( basename " ${ARCHIVE_DIR} " ) " " ${FILE_NAME} " " ${LABEL} " " ./${STARTUP_SCRIPT} " )
35
+ RUN=( ./makeself.sh --nomd5 --nocrc --tar-extra ' --mtime=2019-01-01' --packaging-date ' 1970-01-01T00:00:00Z' --base64 ${NEEDROOT} " $( basename " ${ARCHIVE_DIR} " ) " " ${FILE_NAME} " " ${LABEL} " " ./${STARTUP_SCRIPT} " )
32
36
echo " ${RUN[@]} " > run.log
33
37
34
38
" ${RUN[@]} " > makeself.log 2>&1
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ data "external" "this" {
7
7
8
8
archive_dir = abspath (var. source_dir )
9
9
startup_script = var.source_entrypoint
10
+ dotenv = var.source_environment
10
11
needroot = var.needroot
11
12
12
13
label = var.description
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ variable "source_entrypoint" {
18
18
description = " The script to run when the archive is extracted."
19
19
}
20
20
21
+ variable "source_environment" {
22
+ type = string
23
+ default = " "
24
+
25
+ description = " Dotenv file to be included into the archive."
26
+ }
27
+
21
28
variable "filename" {
22
29
type = string
23
30
default = " makeself.run"
You can’t perform that action at this time.
0 commit comments