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

deployctl saves its data to ~/.deno despite $XDG_CACHE_HOME was set #357

Open
ansipunk opened this issue Feb 3, 2025 · 8 comments · May be fixed by #359 or #358
Open

deployctl saves its data to ~/.deno despite $XDG_CACHE_HOME was set #357

ansipunk opened this issue Feb 3, 2025 · 8 comments · May be fixed by #359 or #358

Comments

@ansipunk
Copy link

ansipunk commented Feb 3, 2025

Deno saves all its stuff to ~/.cache/deno, but deployctl still insists on using ~/.deno/deployctl instead.

@uncenter
Copy link

uncenter commented Feb 4, 2025

I was just thinking this, but I just realized it is not specific to deployctl - anydeno installed global binaries end up here. See denoland/deno#2630. See also https://docs.deno.com/runtime/reference/env_variables/#special-environment-variables ($DENO_DIR environment variable).

@ansipunk
Copy link
Author

ansipunk commented Feb 5, 2025

Interestingly enough, I do have $DENO_DIR set as well.

@uncenter
Copy link

uncenter commented Feb 5, 2025

Interestingly enough, I do have $DENO_DIR set as well.

You might have set it after installing deployctl?

@ansipunk
Copy link
Author

ansipunk commented Feb 5, 2025

Now that you mention that, I'm not sure. What could that mean? I did update my env not by just relogging but by rebooting, I had no .deno in my home but after a deployment it's there again!

@uncenter
Copy link

uncenter commented Feb 5, 2025

Presumably the deployctl shim (exec deno run --allow-all --no-config 'jsr:@deno/deployctl' "$@" in a bash executable) performs an update check before running the deployment command, causing it to be recreated. Maybe your DENO_DIR isn't being exposed correctly to the shim? I'm not exactly sure why that would be, you might have to do some Googling and Stack Overflow-searching 😓

@ansipunk
Copy link
Author

ansipunk commented Feb 5, 2025

@uncenter I just re-read your comment and realized you were talking about the binary, not about state files created by deplyctl itself. No. deployctl saved credentials.json and update.json to ~/.deno/deployctl instead of ~/.cache/deno/deployctl.

@uncenter
Copy link

uncenter commented Feb 5, 2025

I am referring to the binary shim in ~/.deno/bin/deployctl as well as ~/.deno/deployctl/update.json. (I don't seem to have a credentials.json though.)

@uncenter
Copy link

uncenter commented Feb 5, 2025

Ah, I see, there is actually also an issue in this repository for deployctl specifically. I see what you mean.

export function getConfigPaths() {
const homeDir = Deno.build.os == "windows"
? Deno.env.get("USERPROFILE")!
: Deno.env.get("HOME")!;
const configDir = join(homeDir, ".deno", "deployctl");
return {
configDir,
updatePath: join(configDir, "update.json"),
credentialsPath: join(configDir, "credentials.json"),
};
}

I'll write up a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants