-
Notifications
You must be signed in to change notification settings - Fork 8
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
Set working directory when calling pico8 -run #4
Comments
Thank you for your report! |
Thanks for the quick reply! I updated and still have a loading error with the absolute path. I will try to find more info! |
I ran with strace and found that this path is tried:
So pico8 is already aware of the working directory, but passing a full path leads to bad concatenation. |
The original issue was a bad path too: |
This change works for me with the diff --git a/autoload/pico8.vim b/autoload/pico8.vim
index a4ff0ae..c869a58 100644
--- a/autoload/pico8.vim
+++ b/autoload/pico8.vim
@@ -14,7 +14,7 @@ endfunction
function! pico8#run(mods, options) abort
- let cmdline = '"' . pico8#get_config('pico8_path', 'pico8') . '" -run ' . expand('%:p:S')
+ let cmdline = '"' . pico8#get_config('pico8_path', 'pico8') . '" -run ' . expand('%')
if has('win32')
" PICO-8 on Windows does not output logs if run directly.
let cmdline = $ComSpec . ' /C "' . cmdline . '"'
`` |
Hello and thanks for this package!
My projects are in sub-sub-directories of the pico-8 carts location, or in other directories entirely.
I usually run
!pico8 -run %
which works as pico-8 interprets the relative path correctly (I haveautochangedir
note), it does not try to load the filename from its carts directory. With:Pico8Run
I get loading errors.I think the current working directory should be set for the pico-8 process, or the absolute file path should be passed.
The text was updated successfully, but these errors were encountered: