Skip to content

Commit f59c4fe

Browse files
committed
Make sure that environment file exists
Before trying to append new things to it Signed-off-by: Anders F Björklund <[email protected]>
1 parent 0761563 commit f59c4fe

File tree

1 file changed

+3
-1
lines changed
  • pkg/cidata/cidata.TEMPLATE.d

1 file changed

+3
-1
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ WARNING() {
1212
# shellcheck disable=SC2163
1313
while read -r line; do export "$line"; done <"${LIMA_CIDATA_MNT}"/lima.env
1414

15-
sed -i '/#LIMA-START/,/#LIMA-END/d' /etc/environment
15+
if [ -e /etc/environment ]; then
16+
sed -i '/#LIMA-START/,/#LIMA-END/d' /etc/environment
17+
fi
1618
cat "${LIMA_CIDATA_MNT}/etc_environment" >>/etc/environment
1719

1820
# shellcheck disable=SC2163

0 commit comments

Comments
 (0)