lit icon indicating copy to clipboard operation
lit copied to clipboard

get-lit.ps1 fails when cwd has a [ character in its path

Open squeek502 opened this issue 8 years ago • 2 comments

Stumbled upon this, seems like it might be a PowerShell paths issue, but I'm not really sure.

Possibly useful:

Output:

Y:\[>PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"
Downloading https://github.com/luvit/luvi/releases/download/v2.7.6/luvi-regular-Windows-ia32.exe to luvi.exe
Downloading https://lit.luvit.io/packages/luvit/lit/v3.4.5.zip to lit.zip
C:/Users/tim/luvi/src/lua/luvibundle.lua:277: ERROR: C:\lit.zip is not a zip file or a folder
Remove-Item : Cannot find path 'C:\lit.zip' because it does not exist.
At line:35 char:12
+ Remove-Item <<<<  "lit.zip"
    + CategoryInfo          : ObjectNotFound: (C:\lit.zip:String) [Remove-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

lit version: 3.4.5
luvi version: v2.7.6
command: make lit://luvit/luvit luvit.exe luvi.exe
load config: C:\Users\Ryan\AppData\Roaming\litconfig
connecting: wss://lit.luvit.io/
using snapshot: e3390364fed7870917b758d53a049a8ba50f21c5
creating binary: C:\luvit.exe
using luvi from: C:\luvi.exe
fail: [string "bundle:libs/core.lua"]:384: ENOENT: no such file or directory: C:\luvi.exe
stack traceback:
        [C]: in function 'assert'
        [string "bundle:libs/core.lua"]:384: in function 'makeUrl'
        [string "bundle:commands/make.lua"]:13: in function <[string "bundle:commands/make.lua"]:1>
        [string "bundle:main.lua"]:52: in function <[string "bundle:main.lua"]:39>
        [C]: in function 'xpcall'
        [string "bundle:main.lua"]:39: in function <[string "bundle:main.lua"]:31>

It does successfully download luvi.exe and lit.zip to the correct directory (Y:\[), and then the cwd/drive letter gets changed unexpectedly when doing Remove-Item (ObjectNotFound: (C:\lit.zip:String)) and building luvit (it's trying to create C:\luvit.exe using C:\luvi.exe).

squeek502 avatar Jan 19 '17 07:01 squeek502

You're welcome to try to quote things better and test it on your environment. I'm not even sure how to setup a way to reproduce that issue.

creationix avatar Jan 24 '17 19:01 creationix

Haha, yeah, it's a really strange (and specific) edge case. Note that the drive letter stuff is not really related, the same error occurs if the cwd is C:\[, C:\t[e]st, C:\sub\dir\[, etc.

squeek502 avatar Jan 25 '17 00:01 squeek502