Skip to content

Commit c3c415f

Browse files
authored
Merge branch 'master' into improve-exception-logging
2 parents 5e37368 + 7cd1cd6 commit c3c415f

File tree

3 files changed

+57
-54
lines changed

3 files changed

+57
-54
lines changed

Cargo.lock

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ wasmer_detect_profile() {
130130
wasmer_link() {
131131
printf "$cyan> Adding to bash profile...$reset\n"
132132
WASMER_PROFILE="$(wasmer_detect_profile)"
133-
LOAD_STR="\n# Wasmer\nexport WASMER_DIR=\"\$HOME/.wasmer\"\n[ -s \"\$WASMER_DIR/wasmer.sh\" ] && source \"\$WASMER_DIR/wasmer.sh\" # This loads wasmer\n"
134-
SOURCE_STR="# Wasmer config\nexport WASMER_DIR=\"\$HOME/.wasmer\"\nexport WASMER_CACHE_DIR=\"\$WASMER_DIR/cache\"\nexport PATH=\"\$HOME/.wasmer/bin:\$HOME/.wasmer/globals/wapm_packages/.bin:\$PATH\"\n"
133+
LOAD_STR="\n# Wasmer\nexport WASMER_DIR=\"$INSTALL_DIRECTORY\"\n[ -s \"\$WASMER_DIR/wasmer.sh\" ] && source \"\$WASMER_DIR/wasmer.sh\" # This loads wasmer\n"
134+
SOURCE_STR="# Wasmer config\nexport WASMER_DIR=\"$INSTALL_DIRECTORY\"\nexport WASMER_CACHE_DIR=\"\$WASMER_DIR/cache\"\nexport PATH=\"\$WASMER_DIR/bin:\$WASMER_DIR/globals/wapm_packages/.bin:\$PATH\"\n"
135135

136136
# We create the wasmer.sh file
137-
printf "$SOURCE_STR" > "$HOME/.wasmer/wasmer.sh"
137+
printf "$SOURCE_STR" > "$INSTALL_DIRECTORY/wasmer.sh"
138138

139139
if [ -z "${WASMER_PROFILE-}" ] ; then
140140
printf "${red}Profile not found. Tried:\n* ${WASMER_PROFILE} (as defined in \$PROFILE)\n* ~/.bashrc\n* ~/.bash_profile\n* ~/.zshrc\n* ~/.profile.\n"
@@ -156,12 +156,12 @@ wasmer_link() {
156156
echo "If this isn't the profile of your current shell then please add the following to your correct profile:"
157157
printf "$LOAD_STR$reset\n"
158158

159-
version=`$HOME/.wasmer/bin/wasmer --version` || (
159+
version=`$INSTALL_DIRECTORY/bin/wasmer --version` || (
160160
printf "$red> wasmer was installed, but doesn't seem to be working :($reset\n"
161161
exit 1;
162162
)
163163

164-
printf "$green> Successfully installed $version!\n\n${reset}If you want to have the command available now please execute:\nsource $HOME/.wasmer/wasmer.sh$reset\n"
164+
printf "$green> Successfully installed $version!\n\n${reset}If you want to have the command available now please execute:\nsource $INSTALL_DIRECTORY/wasmer.sh$reset\n"
165165
printf "\nOtherwise, wasmer and wapm will be available the next time you open the terminal.\n"
166166
echo "Note: during the alpha release of wapm, telemetry is enabled by default; if you would like to opt out, run \`wapm config set telemetry.enabled false\`."
167167
echo "If you notice anything wrong or have any issues, please file a bug at https://github.com/wasmerio/wapm-cli :)"
@@ -257,7 +257,7 @@ wasmer_install() {
257257
258258
"
259259
fi
260-
# if [ -d "$HOME/.wasmer" ]; then
260+
# if [ -d "$INSTALL_DIRECTORY" ]; then
261261
# if which wasmer; then
262262
# local latest_url
263263
# local specified_version
@@ -286,11 +286,11 @@ wasmer_install() {
286286
# exit 0
287287
# else
288288
# printf "$yellow> $wasmer_alt_version is already installed, Specified version: $specified_version.$reset\n"
289-
# rm -rf "$HOME/.wasmer"
289+
# rm -rf "$INSTALL_DIRECTORY"
290290
# fi
291291
# else
292-
# printf "$red> $HOME/.wasmer already exists, possibly from a past Wasmer install.$reset\n"
293-
# printf "$red> Remove it (rm -rf $HOME/.wasmer) and run this script again.$reset\n"
292+
# printf "$red> $INSTALL_DIRECTORY already exists, possibly from a past Wasmer install.$reset\n"
293+
# printf "$red> Remove it (rm -rf $INSTALL_DIRECTORY) and run this script again.$reset\n"
294294
# exit 0
295295
# fi
296296
# fi

src/installer/wasmer.iss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ DisableWelcomePage=no
1818
Source: "..\..\target\release\wasmer.exe"; DestDir: "{app}\bin"
1919
Source: "..\..\wapm-cli\target\release\wapm.exe"; DestDir: "{app}\bin"
2020

21+
[Dirs]
22+
Name: "{%USERPROFILE}\.wasmer"
23+
2124
[Code]
2225
const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
2326
@@ -68,7 +71,7 @@ begin
6871
if CurStep = ssPostInstall
6972
then begin
7073
EnvAddPath(ExpandConstant('{app}') +'\bin');
71-
EnvAddPath(ExpandConstant('{app}') +'\globals\wapm_packages\.bin');
74+
EnvAddPath(ExpandConstant('{%USERPROFILE}') +'\globals\wapm_packages\.bin');
7275
end
7376
end;
7477
@@ -77,6 +80,6 @@ begin
7780
if CurUninstallStep = usPostUninstall
7881
then begin
7982
EnvRemovePath(ExpandConstant('{app}') +'\bin');
80-
EnvAddPath(ExpandConstant('{app}') +'\globals\wapm_packages\.bin');
83+
EnvAddPath(ExpandConstant('{%USERPROFILE}') +'\globals\wapm_packages\.bin');
8184
end
8285
end;

0 commit comments

Comments
 (0)