Open jayvdb opened 5 years ago
Oh yeah, there will be - Admin checking is a big one, as it only works on Windows. Also that Chocolately isn't for nix as well.
This is one that will be resolved via #61 and #53 - For rewriting Fudge as a module, I'm looking at using classes - to make multiple providers easier to support.
Also that Chocolately isn't for nix as well.
I have a reasonably working choco with https://github.com/chocolatey/choco/pull/1827
I'm going to hack around the Fudge admin checking and see what else doesnt work. Im especially keen on seeing fudge/choco pack working, as that can be used to create fake empty packages that can be installed on Linux for mock/test/development purposes.
List of initial problems:
Test-Chocolatey
invokes choco
, but on linux it will be choco.exe
which is not executable. I've created a shell script choco
to workaround this. Instead, Test-Chocolatey
could fall back to looking for mono
, and/or invoking something like mono choco.exe
. The user then needs to set MONO_PATH
appropriately, but this isnt working for me yet.
Test-AdminUser
fails badly with
Error checking user administrator priviledges Windows Principal functionality is not supported on this platform. Must be running with administrator priviledges for Fudge to fully function
Easy workaround is for Test-AdminUser
to just return false on linux.
choco on linux replies with
Chocolatey v0.10.14-beta-83-g501397c5 Custom unofficial builds are not allowed by default. To override this behavior, explicitly set --allow-unofficial.
Fudge needs to add that --allow-unofficial , always on Linux, or just always always assuming it doesnt break anything. How silly that it needs a flag to run. That is a solution to a non-problem if I ever saw one.
One possible workaround is for the user to add -args '--allow-unofficial'
when invoking fudge, and then adding -Arguments $Arguments everywhere, as https://github.com/Badgerati/Fudge/pull/56 only added it to most of the actions. pack
is one with a different Invoke-Chocolatey
, so the CLI args need to be passed through to choco pack
. choco -v
doesnt need '--allow-unofficial'; there might be a few more which dont. Other actions that use Invoke-Chocolatey(Action)
and dont pass args from the CLI: Remove-Fudgefile
, Restore-Fudgefile
, New-Fudgefile
, Invoke-FudgePrune
, Invoke-FudgeClean
. The alternative is for Invoke-Chocolatey
to add --allow-unofficial
. If it can always be added without side-effects, this is a good option. If it should only be added in some circumstances, then checking those circumstances here could be an annoying overhead.
action pack
should not require admin privileges. Seems this is just an oversight, and needs to be added to the list $isAdminAction = @(...
It seems to work ok without admin privs.
Most of the Write-Notice
in Fudge.ps1 should be Write-Fail
and should return an exit code
Seems like there is a few problems preventing the basics from working. (Note I dont have choco installed yet, so that should be the first error I see)