Skip to content

Conversation

@ShamrockLee
Copy link
Contributor

The previous API requires a temporary file to be created and sourced, which might be a problem in restricted environments where accessing to temporary directories are restricted or where file IO is relatively expensive. Besides, the temporary files are often left undeleted despite the rm line being sourced.

This PR proposes a way to print out the configuration headers through a new function optparse.compose, which can be evaluated (eval "$(optparse.compose)") or sourced (. <<(optparse.compose)) in the user scripts to include the configurations without the need of temporary files.

The changes are a backward-compatible, as optparse.build now write to the temporary file the result of optparse.compose plus the line remove $tempfile.

This PR also include some house-keeping such as removing trailing white spaces and tabs from the generated result, sample_head.sh and README.md.

@ShamrockLee ShamrockLee changed the title Compose Temporary-file-free evaluation by optparse.compose (fullly backward-compatible) Jan 1, 2022
@ShamrockLee ShamrockLee changed the title Temporary-file-free evaluation by optparse.compose (fullly backward-compatible) Tempfile-free evaluation by optparse.compose (fullly backward-compatible) Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant