diff --git a/images/linux/scripts/installers/complete-snap-setup.sh b/images/linux/scripts/installers/complete-snap-setup.sh new file mode 100644 index 000000000..51e631546 --- /dev/null +++ b/images/linux/scripts/installers/complete-snap-setup.sh @@ -0,0 +1,12 @@ +#!/bin/bash +################################################################################ +## File: snap-environment.sh +## Desc: Update /etc/environment to include /snap/bin in PATH +## because /etc/profile.d is ignored by `--norc` shell launch option +################################################################################ + +# Source the helpers +source $HELPER_SCRIPTS/etc-environment.sh + +# Update /etc/environemnt +prependEtcEnvironmentPath "/snap/bin" diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 7ef1a820c..62081af54 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -132,6 +132,16 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts": [ + "{{template_dir}}/scripts/installers/complete-snap-setup.sh" + ], + "environment_vars": [ + "HELPER_SCRIPTS={{user `helper_script_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "shell", "scripts": [ diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 8217608bf..41b758976 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -135,6 +135,16 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts": [ + "{{template_dir}}/scripts/installers/complete-snap-setup.sh" + ], + "environment_vars": [ + "HELPER_SCRIPTS={{user `helper_script_folder`}}" + ], + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, { "type": "shell", "scripts": [