-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bug: Windows executable not using the Working Directory #4361
Comments
It is working as intended. If you need to specify a custom
For more information about the default flag values you can use the |
While I appreciate the fast response and your time, I'd like to make sure this is working as intended. Could be that I didn't demonstrate the issue clearly, but the PowerShell documentation shows that The parameter has no effect, so it seems Pocketbase doesn't use Use case: Why?: Example:
Once again, thank you for your time :) |
By default the Line 85 in 27b6d0c
You could argue that this is opinionated or that it doesn't work within your expectations but it is not a bug. You are free to provide your own default value if the current one doesn't work for your use case. |
@ganigeorgiev is this behavior intended to be consistent across platforms? In my tests on OS X,
|
You are using an alias and the I'll consider replacing |
That's interesting, it must be that zsh/bash sends If I launch So the user experience for anyone running Not a bug but definitely quirky behavior depending on how pb was launched. I never noticed this with pockethost because we always launch with an explicit |
Actually if
I've added it in my todo to experiment with it but that will be during the refactoring. In all cases the actual default |
Yeah to me it makes the most sense that |
Additionally the default PocketBase deployment setup usually fires the executable from within a systemd service file and if we change Having it relative to the executable for me personally is more easy to reason. If we can't find an easy (and performant) way to cover the |
Yes that makes sense too, especially if it would disrupt legacy installations. It's very mysterious to me that |
As mentioned in #4361 (comment), this is most likely because you are accessing the binary indirectly when placed in your PATH (aka. |
I wish to call Pocketbase via a script but use a different working directory.
When calling it, it still creates the
pb_data
folder in$scriptDirectory
(where the Pocketbase executable is located).This also happens when calling it from a nested directory.
I would expect it to create the
pb_data
folder in the directory I called it from (folderA):Image
To debug the issue, I made a little executable that gets called the same way as Pocketbase, that shows the variables that get used by Pocketbase (https://github.com/pocketbase/pocketbase/blob/master/pocketbase.go#L256). See the image below:
Image
Expected behavior: I would expect Pocketbase to use the
os.Getwd()
variable, instead of thefilepath.Dir(os.Args[0])
.Talking with others, this seems to behave as expected on OSX .
The text was updated successfully, but these errors were encountered: