entrez / roku.vim

Vim plugin for Roku development (Scenegraph/Brightscript)
https://www.vim.org/scripts/script.php?script_id=5828
12 stars 3 forks source link

`:RokuInstall` produces error messages when run from deleted dir #10

Closed entrez closed 2 years ago

entrez commented 5 years ago

original title: `:RokuInstall` produces error messages in zsh

expected behavior

:RokuInstall generally produces two lines of output:

compressing channel & uploading to roku (rokutv)
application received: 639321 bytes stored. install success.

actual behavior

when running from a since-deleted cwd, :RokuInstall produces additional unexpected error messages:

compressing channel & uploading to roku (rokutv)
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory application received: 2298299 bytes stored. install success.

steps to reproduce the problem

  1. create a new directory, move into it, and delete it: $ mkdir ~/cwdtest && cd ~/cwdtest && rmdir ~/cwdtest
  2. open a Roku project in neovim with roku.vim installed: $ nvim ~/channels/test/manifest
  3. run :RokuInstall or :RokuInstall <device>: :RokuInstall
  4. see results

    other information

    shell version: zsh 5.7.1 vim version: neovim v0.3.7

entrez commented 5 years ago

actually, i guess i've seen error messages like shell-init: error retrieving current directory produced in the past by running a script in a nonexistent current working directory (e.g. $ mkdir ~/working && cd ~/working && rmdir ~/working). so it's not the shell but the cwd that's the source of the problem.

entrez commented 4 years ago

I think I'm going to ignore this for now, since it seems like it will crop up relatively rarely & would require a disproportionate amount of work to resolve—given that this behavior seems to be common even in many shell built-ins & standard utilities, maybe it's not considered good practice to fix this if the end result will involve hiding error messages from the user and leaving them in the dark about their $PWD being screwy?

So if I do end up making a related change at some point, I'm thinking now that it'll probably just be something like a more informative warning. If someone is aware that the usual/best approach to this is different, though, please hit up my beeper :pager: :call_me_hand: