Skip to content

Commit

Permalink
Remove export_bake.bat since it breaks Windows PATH. See: SanderMerte…
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroErrors committed Aug 2, 2023
1 parent 46eed0f commit 8965959
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,36 +146,8 @@ int16_t bake_create_script(bool local, bool nopass)
fprintf(f, ")\n\n");
fclose(f);

char *script_path = ut_envparse(BAKE_SCRIPT_PATH);
if (!script_path) {
ut_error("failed to open '%s'", BAKE_SCRIPT_PATH);
}

if (!local) {
const char *path = ut_getenv("BAKE_USERPATH");
if (!path || !strstr(path, script_path)) {
ut_trace("add bake directory to user PATH");
char *path_w_bake = ut_asprintf("%s;%s", path, script_path);
f = fopen("export_bake.bat", "w");
if (!f) {
ut_throw("failed to create export script");
goto error;
}
fprintf(f, "@echo on\n");
fprintf(f, "setx PATH \"%s\"\n", path_w_bake);
fclose(f);

ut_try(cmd("export_bake.bat"), "failed to run export script");

ut_try(ut_rm("export_bake.bat"), "failed to remove export script");
} else {
bake_in_path = true;
}
}

free(vc_shell_cmd);
free(script_file_path);
free(script_path);

return 0;
error:
Expand Down

0 comments on commit 8965959

Please sign in to comment.