Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix paths #90

Merged
merged 1 commit into from
Jan 29, 2024
Merged

fix paths #90

merged 1 commit into from
Jan 29, 2024

Conversation

vahtos
Copy link
Contributor

@vahtos vahtos commented Jan 26, 2024

Closes: #68

The requires syntax that was used in various modules is problematic because it stores the results of paths.get() at import time. This is probably best illustrated with an example:

const paths = require("./paths.js")
const paths2 = require("./paths.js").get();

paths.seed("/a/path/config", "/a/path/file")
console.log(paths.get().config); // <--- /a/path/config
console.log(paths2.config); // <--- !!! returns the default value: the results of resolve(os.homedir()), "/.droppy/config")
// because paths2 is set to the returned object of paths.get() at import time

@markhughes markhughes merged commit c93f6ef into droppyjs:canary Jan 29, 2024
14 checks passed
@vahtos vahtos deleted the fix_paths branch January 29, 2024 17:59
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.

unable to change file location
2 participants