Closed radu-matei closed 6 years ago
@radu-matei you might get some help from the windows folks. Would you like me to wire you up? Likely it's an easy error for them....
Ok, here's what happens:
draft-pack-repo
version v0.4.1 in the plugins/draft-pack-repo
directory:PS C:\Users\radum\.draft\plugins\draft-pack-repo> git status
HEAD detached at v0.4.1
nothing to commit, working tree clean
Now if we look at get.ps1
in our directory and at get.ps1
in the v0.4.1 commit, we see that the version set for it is canary
, so the plugin will try to install the canary
release from GitHub, which is missing (plus a mismatch with v$version
).
If you modify the install script / clone the correct branch and execute the script again, it downloads correctly, but $Env:DRAFT_HOME
is not set, so it cannot copy in the correct folder:
Preparing to install into \plugins\draft-pack-repo\bin
pack-repo installed into \plugins\draft-pack-repo\bin\pack-repo.exe
And for a brief summary of this issue:
draft-pack-repo
off master, draft init
doesn't set the DRAFT_HOME
envI'm having the same issue on Windows
For the record, you can still use Draft, just the pack repo functionality is missing, and you can manually add the executable:
download the release from this url - https://github.com/draftcreate/draft-pack-repo/releases/download/v0.4.1/pack-repo-v0.4.1-windows-amd64.zip
unzip it and copy the executable in DRAFT_HOME\plugins\draft-pack-repo\bin
This workaround works for me on Windows:
C:\Users\mafishe> draft init
C:\Users\mafishe> draft plugin remove pack-repo
C:\Users\mafishe> draft plugin install https://github.com/draftcreate/draft-pack-repo --version master
C:\Users\mafishe> draft init
Installing default plugins...Installation of default plugins complete
Installing default pack repositories...
Installing pack repo from https://github.com/Azure/draft
Installed pack repository github.com/Azure/draft
Installation of default pack repositories complete
$DRAFT_HOME has been configured at C:\Users\mafishe\.draft.
Happy Sailing!
The problem is indeed what you mentioned, @radu-matei: draft init
installs draft-pack-repo v0.4.1, but get.ps1 points to the canary release. This was fixed in master for draft-pack-repo by hardcoding get.ps1 to install v0.4.1 (see https://github.com/draftcreate/draft-pack-repo/pull/21), which is why the above workaround works. :)
Honestly, the best move forward is to implement #688. The current install process for plugins is proving to be very fragile, and we were planning on doing that work anyways in 0.15. The powershell script support for plugins was purely a crutch just to get this all to work, which is why I've been focusing so hard on GoFish outside of work hours recently.
Rather than coming up with yet another crutch, we should just bite the bullet and get the work done. This software is early and users are still able to get Draft working on windows using the above workarounds for the time being. If we were 1.0+ then I'd say let's do another patch release, but honestly I'd rather do the work once, and do it right.
Deleted the
.draft
directory,draft version
below:When doing
draft init
:After this step the terminal (Powershell or CMD) quits entirely - it cloned
draft-pack-repo
in the plugin directory. If I try to execute thescripts\get.ps1
manually, it's denied because of the execution policy.If I set the execution policy to
Unrestricted
and execute the get script manually:This seems to be because of the deprecation of
TLSv1/TLSv1.1
by GitHubTo check the (what I think is the default) security protocol:
appears to be
Tls
, which I think isTLSv1
.If you go further and set the protocol for this session to be
TLSv1.2
:and try to execute the script again - not
draft init
, as the command above is only valid for the current session:The same error -
The request was aborted: The connection was closed unexpectedly.
also appears if I switch toInvoke-WebRequest
At this point I've started looking at what version of the .NET Framework I have installed - .NET Framework 4.7.1, which comes by default with Windows 10 Fall Creators Update.
I added all supported protocols:
Still the same error on a different network, and on another Windows PC.
This is annoying.