Skip to content

Commit

Permalink
Fix regression in the PYAPP_EXEC_SPEC option
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Jun 26, 2023
1 parent 60567e3 commit a7f3780
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ fn set_execution_mode() {
// Set defaults
set_runtime_variable(module_variable, "");
set_runtime_variable(code_variable, "");
set_runtime_variable("PYAPP__EXEC_CODE_ENCODED", "0");
set_runtime_variable(script_variable, "");
set_runtime_variable("PYAPP__EXEC_SCRIPT_NAME", "");
set_runtime_variable("PYAPP__EXEC_SCRIPT_ID", "");
Expand Down Expand Up @@ -691,6 +692,7 @@ fn set_execution_mode() {
);
} else if !code.is_empty() {
set_runtime_variable(code_variable, STANDARD_NO_PAD.encode(code));
set_runtime_variable("PYAPP__EXEC_CODE_ENCODED", "1");
} else if !script.is_empty() {
let path = PathBuf::from(&script);
if !path.is_file() {
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

***Fixed:***

- Fix regression in the `PYAPP_EXEC_SPEC` option

## 0.10.0 - 2023-06-26

***Added:***
Expand Down
6 changes: 5 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ pub fn exec_module() -> String {
}

pub fn exec_code() -> String {
decode_option(env!("PYAPP_EXEC_CODE"))
if env!("PYAPP__EXEC_CODE_ENCODED") == "1" {
decode_option(env!("PYAPP_EXEC_CODE"))
} else {
env!("PYAPP_EXEC_CODE").into()
}
}

pub fn exec_script() -> String {
Expand Down

0 comments on commit a7f3780

Please sign in to comment.