squattingmonk/nasher

Unable to open nwn_base.key

Closed this issue · 9 comments

Compiling 93 scripts
WARNING
... Failed to open .key archive '~/.steam/steam/steamapps/common/Neverwinter/data/nwn_base.key'
... exception 'Failed to open KEY file.'.
Success: compiled 93 scripts

Looks like it's mangling the path because of the space.

should be common/Neverwinter Nights/data/nwn_base.key

What is the output of nasher config --global nssFlags && nasher config --local nssFlags?

-n ~/.steam/steam/steamapps/common/Neverwinter\ Nights/data

The output at the top actually did have the backslash in it, but it doesn't render in the comment.

When you run with --verbose, does it show the correct command being passed to nwnsc before this error message?

$ nasher pack mymod --verbose
Located script compiler at /home/darren/NWN/bin/nwnsc
Located erf utility at /home/xxx/.nimble/pkgs/neverwinter-1.4.2/nwn_erf
Located gff utility at /home/xxx/.nimble/pkgs/neverwinter-1.4.2/nwn_gff
Located tlk utility at /home/xxx/.nimble/pkgs/neverwinter-1.4.2/nwn_tlk
Packing target mymod
Updating cache for target mymod
Updating area list
Success: area list updated --> 22 areas listed
Compiling 94 scripts
WARNING
... Failed to open .key archive '~/.steam/steam/steamapps/common/Neverwinter/data/nwn_base.key'
... exception 'Failed to open KEY file.'.
Success: compiled 94 scripts
Packing files for target shire into mod/mymod.mod
Prompt: mod/mymod.mod already exists. Overwrite? (Y/n)
Hint: The file to be packed is newer than the existing file
Answer: yes
Success: packed mod/mymod.mod

If you look at this line

WARNING
... Failed to open .key archive '~/.steam/steam/steamapps/common/Neverwinter/data/nwn_base.key'

You'll see it's missing some of the folder name. That's because there's a space in your folder name. You need to use escapes because nwnsc doesn't handle spaces file and folder names.

Sorry, I should have asked for --debug rather than --verbose. Was trying to figure out if nasher is sending a bad command or if nwnsc just can't read it. Looks like it's nasher's fault. The Nim method I used to handle the arguments only handles whitespace within quotes.

I will see if there's an elegant way to fix this. A workaround for now is to use quotation marks around your path rather than escaping spaces. For example:

nasher config --nssFlags:'-n "/home/youruserhere/.steam/steam/steamapps/common/Neverwinter Nights"'

Note that since you have to wrap it in single quotes, you have to use the full path. The ~/ will not be expanded.

Ok, thanks.

I'm not planning on making a change here after all. Using quotes to surround paths with spaces is the solution.

Note that using quotes is only necessary in the issue above since the path is itself part of another string. On Posix systems it's the shell that usually handles escaping spaces (as well as expansion of the tilde), so this works fine:

$ nasher config installDir ~/Documents/Neverwinter\ Nights