Giter VIP home page Giter VIP logo

godotenv's Issues

Failed to start a process with file path 'unzip'

System.ComponentModel.Win32Exception: Failed to start a process with file path 'unzip'. Target file or working directory doesn't exist or the provided credentials are invalid.
    System.ComponentModel.Win32Exception: An error occurred trying to start process 'unzip' with working directory '/root/.config/godotenv/godot/versions'. No such file or directory
      at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) 
      at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) 
      at CliWrap.Utils.ProcessEx.Start() in /D:\a\CliWrap\CliWrap\CliWrap\Utils\ProcessEx.cs:66
  at CliWrap.Utils.ProcessEx.Start() in /D:\a\CliWrap\CliWrap\CliWrap\Utils\ProcessEx.cs:76
  at CliWrap.Command.ExecuteAsync(CancellationToken cancellationToken) in /D:\a\CliWrap\CliWrap\CliWrap\Command.cs:508
  at Chickensoft.GodotEnv.Common.Utilities.ProcessRunner.Run(String workingDir, String exe, String[] args) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/utilities/ProcessRunner.cs:78
  at Chickensoft.GodotEnv.Common.Utilities.Shell.Run(String executable, String[] args) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/utilities/Shell.cs:27
  at Chickensoft.GodotEnv.Common.Clients.ZipClientTerminal.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, IProgress`1 progress, ILog log) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/clients/ZipClientTerminal.cs:32
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.ExtractGodotInstaller(GodotCompressedArchive archive, ILog log) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:328
  at Chickensoft.GodotEnv.Features.Godot.Commands.GodotInstallCommand.ExecuteAsync(IConsole console) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/commands/install/GodotInstallCommand.cs:76
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

On my Manjaro machine the download of a new godot version doesn't work.
My guess is that the /root access causes problems because its read only.

[FEATURE] Adding .desktop files / Start Menu shortcuts

Hi, I've been looking at a bunch of different version managers but I quite like this one. I was wondering if it would be possible to extract a .desktop file to the relevant location on Linux to include in an application launcher (and/or similar for Windows' Start Menu). I believe for Linux this would be /usr/share/applications/.

It would probably be best to have multiple configurations for this, something like

  • All installed versions show (in a folder?)
  • Only the active version shows
  • No versions show

Reinstalling remote addon fails on Windows

After installing a remote addon, running chicken addons install again will fail with an error like:

Attempting to install "godot_dialogue_manager."

  Installing: Addon "godot_dialogue_manager" from `C:\proj\MyGame\addons.json` at `addons/dialogue_manager/` on branch `main` of `https://github.com/nathanhoad/godot_dialogue_manager`
Failed to install "godot_dialogue_manager": Access to the path 'c08d5210ed51de792f91538f9befb696e51faa' is denied.

Example addons.json

{
  "addons": {
    "godot_dialogue_manager": {
      "url": "https://github.com/nathanhoad/godot_dialogue_manager",
      "subfolder": "addons/dialogue_manager"
    }
  }
}

bug: not finding GodotSharp on macOS (possibly other platforms)

I need to fix this ASAP.

Not finding GodotSharp on macOS (possibly other platforms) when GODOT env var is invoked on command line. Opening up the Godot binary itself from Finder doesn't seem to have that issue.

When making https://github.com/chickensoft-games/setup-godot, the trick was to create and track an additional symlink to the GodotSharp folder included in the Godot app and add it to the system path. GodotEnv almost certainly needs to be doing something like that.

Screen Shot 2023-09-16 at 9 10 49 AM

On my system, the symlink to Godot ends up being /Users/joanna/.config/godotenv/godot/bin.

Instead of adding to the system path, I can probably create another symlink. This is because it is expecting GodotSharp to be based off a value that can be inferred from the current symlink: it's dropping the /bin and concatenating /GodotSharp/Api/Debug to the symlink. So, creating and maintaining a second symlink with the expected path should fix the issue, just like in setup-godot.

Amazing that $GODOT --version works — that's what kept me from noticing this in CI/CD. But actually running godot from CLI does not.

Various first time install issues

Hello!

I just setup a new Mac (macOS 14.1.1) and in setting up everything necessary for Godot, I wanted to check out godotenv as well. I came across various first time install issues for which the docs didn't provide any guidance or requirements.

First, I ran into this:

godotenv --help
You must install or update .NET to run this application.

App: /Users/adriaan/.dotnet/tools/godotenv
Architecture: arm64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (arm64)
.NET location: /usr/local/share/dotnet

The following frameworks were found:
  8.0.0 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=arm64&rid=osx-arm64&os=osx.14

Then, after installing dotnet 6.0.0 on top of the newer 8.0.0 already on my Mac (which seems silly, but ok), I ran into the following:

godotenv godot install 4.2.0-rc.1
🍏 Running on macOS
🤖 Godot v4.2.0-rc.1
🍯 Parsed version: Major(4).Minor(2).Patch(0)-Label(rc.1)
😁 Using Godot with .NET
⬇ Downloading Godot...
🌏 Godot download url: https://github.com/godotengine/godot-builds/releases/download/4.2-rc1/Godot_v4.2-rc1_mono_macos.universal.zip
🧼 Cleaning up...
✨ All clean!
🗄 Cache path: godotenv/godot/cache/godot_dotnet_4_2_0_rc_1
📄 Cache filename: godot_dotnet_4_2_0_rc_1.zip
💾 Compressed installer path: godotenv/godot/cache/godot_dotnet_4_2_0_rc_1/godot_dotnet_4_2_0_rc_1.zip
🚀 Downloaded Godot: 100%% at 41,76 MB/s      

✅ Godot successfully downloaded.

ERROR
System.InvalidOperationException: Failed to run `unzip` in `godotenv/godot/versions` with args `-l godotenv/godot/cache/godot_dotnet_4_2_0_rc_1/godot_dotnet_4_2_0_rc_1.zip`. Received exit code 9.
  at Chickensoft.GodotEnv.Common.Utilities.Shell.Run(String executable, String[] args) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/utilities/Shell.cs:29
  at Chickensoft.GodotEnv.Common.Clients.ZipClientTerminal.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, IProgress`1 progress, ILog log) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/clients/ZipClientTerminal.cs:32
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.ExtractGodotInstaller(GodotCompressedArchive archive, ILog log) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:319
  at Chickensoft.GodotEnv.Features.Godot.Commands.GodotInstallCommand.ExecuteAsync(IConsole console) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/commands/install/GodotInstallCommand.cs:74
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

I haven't figured out yet how to get around this one yet, so any help would be appreciated.

CLI Throws Error When Using Same Remote Twice

Hey there. I really like this addon management CLI its super nice!
But I encountered a problem when I have 2 addons that come from the same git repository.
I use different subfolders for different tools but like to have them all in one repository.
So I used following addons.json file.
addons.log

And when running the chicken addon install command it throws following error:
ERROR System.ArgumentException: An item with the same key has already been added. Key: https://gitlab.com/project/godottools.git at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Chickensoft.Chicken.AddonRepo.LoadCache(Config config) in \Users\joanna\Dropbox\GameDev\Chickensoft\chicken\Chicken\src\addon\AddonRepo.cs:50 at Chickensoft.Chicken.AddonManager.InstallAddons(String projectPath, Nullable`1 maxDepth) in \Users\joanna\Dropbox\GameDev\Chickensoft\chicken\Chicken\src\addon\AddonManager.cs:37 at Chickensoft.Chicken.InstallCommand.ExecuteAsync(IConsole console) in \Users\joanna\Dropbox\GameDev\Chickensoft\chicken\Chicken\src\command s\AddonInstallCommand.cs:41 at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in D:\a\CliFx\CliFx\CliFx\CliApplication.cs:147 at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in D:\a\CliFx\CliFx\CliFx\CliApplication.cs:191

It seems to be fine if I delete the .addons and addon folder but this seems more like a workaround.

Support Godot 3

There are some discrepancies in the download file names from Godot 3 to 4 that we can resolve to support Godot 3.

Set GODOT environment variable in both ".bashrc" and ".bash_profile" shell configuration files on Unix

GodotEnv currently only sets the GODOT environment variable (along with changes to PATH) inside the ".bashrc" file. However, we found out through Discord discussion that on an Arch-based OS, VSCode will not read environment variables correctly unless they are set in user's ".bash_profile" file. Setting the variable in both places would allow Arch-based distros to work out of the box like the rest.

godotenv godot list gives NullReferenceException

Using GodotEnv v1.5.0 on macOS 14.1.1, I ran into an issue that the version list now always returns a NullReferenceException. Here's the terminal output that preceded it:

adriaan@Adriaans-MacBook ~ % godotenv godot list
4.2.0-rc.1 dotnet *
adriaan@Adriaans-MacBook ~ % godotenv godot install 4.2.0-rc2
🍏 Running on macOS
🤖 Godot v4.2.0-rc2
🍯 Parsed version: Major(4).Minor(2).Patch(0)-Label(rc2)
😁 Using Godot with .NET
⬇ Downloading Godot...
🌏 Godot download url: https://github.com/godotengine/godot-builds/releases/download/4.2-rc2/Godot_v4.2-rc2_mono_macos.universal.zip
🧼 Cleaning up...
✨ All clean!
🗄 Cache path: /Users/adriaan/.config/godotenv/godot/cache/godot_dotnet_4_2_0_rc2
📄 Cache filename: godot_dotnet_4_2_0_rc2.zip
💾 Compressed installer path: /Users/adriaan/.config/godotenv/godot/cache/godot_dotnet_4_2_0_rc2/godot_dotnet_4_2_0_rc2.zip
🚀 Downloaded Godot: 100%% at 27,51 MB/s      

✅ Godot successfully downloaded.

🗜 Extracted 199 / 199 files in /Users/adriaan/.config/godotenv/godot/cache/godot_dotnet_4_2_0_rc2/godot_dotnet_4_2_0_rc2.zip.
🚀 Extracting Godot installation files: 100%
🗜 Successfully extracted Godot to:

  /Users/adriaan/.config/godotenv/godot/versions/godot_dotnet_4_2_0_rc2


🔗 Linking GodotSharp /Users/adriaan/.config/godotenv/godot/GodotSharp -> /Users/adriaan/.config/godotenv/godot/versions/godot_dotnet_4_2_0_rc2/Godot_mono.app/Contents/Resources/GodotSharp
✅ Godot symlink updated.

/Users/adriaan/.config/godotenv/godot/bin -> /Users/adriaan/.config/godotenv/godot/versions/godot_dotnet_4_2_0_rc2/Godot_mono.app/Contents/MacOS/Godot

Godot symlink path:

/Users/adriaan/.config/godotenv/godot/bin

📝 Adding or updating the GODOT environment variable.

Successfully updated the GODOT environment variable.


You may need to restart your shell or run the following 
to get the updated environment variable value.

    source ~/.zshrc

/Users/adriaan/.config/godotenv/godot/bin
adriaan@Adriaans-MacBook ~ % godotenv godot list             
ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__39_0(GodotInstallation i) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:521
  at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count) 
  at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count) 
  at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count) 
  at System.Linq.OrderedEnumerable`1.ToList() 
  at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.GetInstallationsList() in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:493
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ListLocalVersions(ILog log, IGodotRepository godotRepo) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/commands/GodotListCommand.cs:25
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ExecuteAsync(IConsole console) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/godot/commands/GodotListCommand.cs:53
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

Issue persists even after restarting the terminal and running godotenv godot cache clear. Any ideas how to fix this or further debug this?

System.NullReferenceException When Running `godotenv godot list`

I encountered an error while attempting to list the Godot installations using the godotenv command. Could it be Dropbox?

Here are the specifics:

Command:

godotenv godot list

Error Message:

ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__35_0(GodotInstallation i) in /Users/joanna/Dropbox/GameDev/Chickensoft/chicken/GodotEnv/src/features/godot/domain/GodotRepository.cs:415
  ...
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

Environment:

  • OS: macOS Sonoma 14.0
  • godotenv Version: 1.0.0
  • .NET Runtime Version: .NET 7

Ability to version lock addons

While I like the concept of being able to manage addons using just an addons.jsonc file, there doesn't seem to be a way to lock which version of the addons you want to use. In addition GodotEnv grabs the main branch which could potentially be in a broken state compared to a release.

feat: support more forgiving input version strings

After installing the newest prerelease version of Godot using:

godotenv godot install 4.3.0-beta1

I tried to check to see if things were set up correctly so I ran:

godotenv godot list

And got the following output:

ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__48_0(GodotInstallation i) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:595
  at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
  at System.Linq.OrderedEnumerable`1.ToList()
  at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.GetInstallationsList() in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:567
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ListLocalVersions(ILog log, IGodotRepository godotRepo) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:25
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ExecuteAsync(IConsole console) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:53
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in \_\CliFx\CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in \_\CliFx\CliApplication.cs:193

My initial guess is that the new version doesn't quite match what godotenv is expecting, but I haven't looked at the code, so I'm not sure.

add ability to install export templates

It would be nice if there was a flag -e or --export-templates for godotenv godot install that would also install the relevant export templates on mac/win/linux.

Additionally, you might also need a separate command just to install the export templates (if you hadn't supplied the flag during installation) and probably one to check if they were installed.

Naturally, this would need to work across each of the 3 major OS's, which means installing the export templates to the correct location. Someone had graciously contributed the support for this to https://github.com/chickensoft-games/setup-godot a while back, and I believe I even ported some of the relevant logic for it to GodotEnv, but it will likely need updates.

Attempting to run git commands in ./addons when no .git directory exists

// Godot addons configuration file for use with the GodotEnv tool.
// See https://github.com/chickensoft-games/GodotEnv for more info.
// -------------------------------------------------------------------- //
// Note: this is a JSONC file, so you can use comments!
// If using Rider, see https://youtrack.jetbrains.com/issue/RIDER-41716
// for any issues with JSONC.
// -------------------------------------------------------------------- //
{
  "$schema": "https://chickensoft.games/schemas/addons.schema.json",
  // "path": "addons", // default
  // "cache": ".addons", // default
  "addons": {
    "imrp": { // name must match the folder name in the repository
      "url": "https://github.com/MakovWait/improved_resource_picker",
      // "source": "remote", // default
      // "checkout": "main", // default
      "subfolder": "addons/imrp"
    }
  }
}

The default addons.jsonc file shown above seems to be trying to run git config --local user.email [email protected] in ./addons/imrp/ after moving the the ./.addons/imrp/addons/imrp/ directory to this location. Since this isn't moving over the whole repo and is instead moving a subfolder, this command fails because it is no longer a git repo.

Relevant output:

$ godotenv.exe addons install
Discovered "imrp."

  Resolved: Addon "imrp" from `addons.jsonc` at `addons/imrp/` on branch `main` of `https://github.com/MakovWait/improved_resource_picker`

An error was encountered while attempting to install addons.

System.InvalidOperationException: Failed to run `git` in `V:\godot-game\addons\imrp\` with args `config --local user.email [email protected]`. Received exit code 128.
   at Chickensoft.GodotEnv.Common.Utilities.Shell.Run(String executable, String[] args) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/utilities/Shell.cs:line 29
   at Chickensoft.GodotEnv.Features.Addons.Domain.AddonsRepository.InstallAddonFromCache(IAddon addon, String cacheName) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/addons/domain/AddonsRepository.cs:line 220
   at Chickensoft.GodotEnv.Features.Addons.Commands.AddonsLogic.State.Unresolved.On(Install input) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/addons/commands/install/AddonsLogic.cs:line 141
   at Chickensoft.LogicBlocks.LogicBlockAsync`1.RunSafe(Func`1 handler, TState fallback)

An error occurred while installing addons:
Failed to run `git` in `V:\godot-game\addons\imrp\` with args `config --local user.email [email protected]`. Received exit code 128.

Could not resolve addons. Please address any errors and try again.

Allow for "manual" or "override" addons

Maybe this already exists or is a moot point based on how the addon manager works, but after looking around the documentation, I couldn't find any details on this.

But I do think there are cases where you would want both packages managed by GodotEnv, and some packages managed manually.
An example of this from my own experience are some hacky changes I made to TweenSuite to suit my project's needs. Those are changes I wouldn't try to merge back in because it's, again, very hacky and likely not fool proof outside of my use cases.

So my idea is that you'd be able to define a source as "manual". Maybe on addon install, GodotEnv can add these manual addons to the gitignore?

A few points on this idea:

  • Moving modified addons outside of the addons folder creates some issues with the godot editor itself. Especially if it's a plugin like TweenSuite. So as far as I can tell, that isn't a viable solution.
  • In the event a project would be using godotEnv for addon management, these overrides would be the exception rather than the norm.
  • Godot Env should treat these as exceptions. Maybe require a reason field for documentations sake? At the very least give a special notice/warning while installing packages.
  • This would also, presumably, prevent addon conflicts.

GodotEnv generating Invalid Symbolic Link on Windows for non dotnet installations

I'm winding up with an invalid symbolic link after calling godotenv godot use 4.1.2 -n on Windows with a non-dotnet installation of Godot 4.1.2.

Steps to Reproduce:

  1. Install non-dotnet godot 4.1.2 godotenv godot install 4.1.2 --no-dotnet.
  2. Activate it for use godotenv godot use 4.1.2 -n.

Expected:
Running %godot% from a cmd terminal should launch the desired non-dotnet version of Godot.

Actual:
Running %godot% from a cmd terminal yields the following error:

'C:\Users\...\AppData\Roaming\godotenv\godot\bin' is not recognized as an internal or external command, operable program or batch file.

It appears that the generated symlink expects a subdirectory to be present:
versions\godot_4_1_2\Godot_v4.1.2-stable_win64.exe\Godot_v4.1.2-stable_win64.exe

When in reality the path to the binaries is:
versions\godot_4_1_2\Godot_v4.1.2-stable_win64.exe

.Net enabled builds do use a subfolder for the binaries directory and work as expected.

Avoid spamming the elevation prompt on Windows

Running godotenv godot use <version> or godotenv godot install <version> asks for elevation 5 times in rapid succession. It can become quite annoying. Play with sound, each bell is a full screen elevation prompt:

Code_dE725OMceZ.mp4

We might want to consider, on Windows, to elevate the entire tool process at the start of the command if needed?

On a semi-related note, I don't believe the UACHelper library is needed. The following patch would work seamlessly AFAIK.

-    var process = UACHelper.UACHelper.StartElevated(new ProcessStartInfo() {
-      FileName = exe,
-      Arguments = args,
-      UseShellExecute = true,
-      CreateNoWindow = false
-    });
+    Process process = new() {
+      StartInfo = new() {
+        FileName = exe,
+        Arguments = args,
+        UseShellExecute = true,
+        Verb = "runas",
+        CreateNoWindow = false,
+      }
+    };

`godotenv godot list` throws NullReferenceException

Regular godotenv godot list (which I would expect to list locally installed managed versions) throws

System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__48_0(GodotInstallation i) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:595
  at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
  at System.Linq.OrderedEnumerable`1.ToList()
  at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.GetInstallationsList() in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:567
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ListLocalVersions(ILog log, IGodotRepository godotRepo) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:25
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ExecuteAsync(IConsole console) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\GodotListCommand.cs:53
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in \_\CliFx\CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in \_\CliFx\CliApplication.cs:193

VS Code gets confused by backslashes in $GODOT

In Windows, the path stored in the GODOT environment variable contains backslashes. This causes problems with some tools eg Visual Studio Code - using ${GODOT} as the program name in launch.json does not work, but pasting the path in directly and changing backslashes to forward slashes does work.

Could you add a command line option to use forward slashes when setting the GODOT variable?

[FEATURE] Support for other shells

Currently, the program aliases the Godot path in the .bashrc file on Linux and .zshrc on Mac, but not everyone uses Bash on Linux (for example, I use ZSH). Is it possible to instead specify the output file in the godotenv godot env setup command or similar?

Add explicit proxy support for godotenv

Trying to install godot using godotenv godot install 4.2.2 command, and after successfully download godot, here is what I get at verifying checksum stage:

Detailed Console Message

? Verifying Checksum
ERROR
System.Net.Http.HttpRequestException: The requested name is valid, but no data of the requested type was found. (raw.githubusercontent.com:443)
    System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found.
      at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
      at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
      at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
      at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
  at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async,
 Boolean doRequestAuth, CancellationToken cancellationToken)
  at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
  at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
  at Chickensoft.GodotEnv.Common.Clients.NetworkClient.WebRequestGetAsync(String url) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\common\clients\NetworkClient.cs:49
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotChecksumClient.GetExpectedChecksumForArchive(GodotCompressedArchive
 archive) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotChecksumClient.cs:66
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotChecksumClient.VerifyArchiveChecksum(GodotCompressedArchive archive) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotChecksumClient.cs:57
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.VerifyArchiveChecksum(ILog log, GodotCompressedArchive archive) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:337
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.DownloadGodot(SemanticVersion version, Boolean isDotnetVersion, Boolean skipChecksumVerification, ILog log, CancellationToken token) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\domain\GodotRepository.cs:319
  at Chickensoft.GodotEnv.Features.Godot.Commands.GodotInstallCommand.ExecuteAsync(IConsole console) in \home\runner\work\GodotEnv\GodotEnv\GodotEnv\src\features\godot\commands\install\GodotInstallCommand.cs:77
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in \_\CliFx\CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in \_\CliFx\CliApplication.cs:193

I strongly doubt that cannot using proxy(which links to #49 ) is the reason of this error(I mean, I cannot direct reach github without the help of proxy in my current network envirionment). How can I further locate where goes wrong?

feature: list available godot versions

It would nice to have a way to list the available versions of godot.
Right now, you can only list installed versions. To install a new version, you need to open the NuGet gallery and check the available versions there.

Maybe the "godotenv godot list" command could return the last 5 released versions (along with the currently installed ones)

Failed to copy addon

When running godotenv addons install in a brand new chickengame project with the following addons.jsonc I receive a failed to copy exception.

Repo steps

run dotnet new chickengame --name "ReproTest" & cd into it

run godotenv addons init

Modify addons.jsonc to be

// Godot addons configuration file for use with the GodotEnv tool.
// See https://github.com/chickensoft-games/GodotEnv for more info.
// -------------------------------------------------------------------- //
// Note: this is a JSONC file, so you can use comments!
// If using Rider, see https://youtrack.jetbrains.com/issue/RIDER-41716
// for any issues with JSONC.
// -------------------------------------------------------------------- //
{
  "$schema": "https://chickensoft.games/schemas/addons.schema.json",
  // "path": "addons", // default
  // "cache": ".addons", // default
  "addons": {
    "steam-mutliplayer-peer": {
      "url": "https://github.com/expressobits/steam-multiplayer-peer",
      "checkout": "addon",
      "subfolder": "addons/steam-mutliplayer-peer"
    }
  }
}

run godotenv addons install

Result

Discovered "steam-mutliplayer-peer."

  Resolved: Addon "steam-mutliplayer-peer" from `addons.jsonc` at `addons/steam-mutliplayer-peer/` on branch `addon` of `https://github.com/expressobits/steam-multiplayer-peer`

An error was encountered while attempting to install addons.

System.IO.IOException: Failed to copy `S:\projects\ReproTest\.addons\steam-mutliplayer-peer\addons/steam-mutliplayer-peer\` to `S:\projects\ReproTest\addons\steam-mutliplayer-peer\`
   at Chickensoft.GodotEnv.Common.Clients.FileClient.CopyBulk(IShell shell, String source, String destination) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/common/clients/FileClient.cs:line 496
   at Chickensoft.GodotEnv.Features.Addons.Domain.AddonsRepository.InstallAddonFromCache(IAddon addon, String cacheName) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/addons/domain/AddonsRepository.cs:line 215
   at Chickensoft.GodotEnv.Features.Addons.Commands.AddonsLogic.State.Unresolved.On(Install input) in /home/runner/work/GodotEnv/GodotEnv/GodotEnv/src/features/addons/commands/install/AddonsLogic.cs:line 141      
   at Chickensoft.LogicBlocks.LogicBlockAsync`1.RunSafe(Func`1 handler, TState fallback)

An error occurred while installing addons:
Failed to copy `S:\projects\ReproTest\.addons\steam-mutliplayer-peer\addons/steam-mutliplayer-peer\` to `S:\projects\ReproTest\addons\steam-mutliplayer-peer\`

Could not resolve addons. Please address any errors and try again.

Manually copying the addons/steam-multiplayer-peer directory into addons from .addons works just fine, godotenv is just unable to do it by itself.
All other addons work fine including gdsteam (another gdextension)

Some Unit Tests Fail on Windows

Description

While preparing to start work on #12 I found that several unit tests are failing on Windows (tested on two machines).

I've yet to go through all the tests, but I have identified a few fail due to assertions expecting \n but the console output string on Windows will be \r\n.

I'll work through these issues first and then get started on #12

Screenshots

Screenshot 2023-09-29 202723

Checksum validation returns HTTP StatusCode 404

When installing any version of Godot the checkum validation fails with a HTTP status code 404.

Command run

godotenv godot install 4.3.0-dev.6

image

My environment
Windows 11

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.8d38d0cc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   c:\program files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.8d38d0cc
 [maui-windows]
   Installation Source: VS 17.8.34316.72
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.8.34316.72
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.8.34316.72
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [android]
   Installation Source: VS 17.8.34316.72
   Manifest Version:    34.0.43/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  1.0.4 [c:\program files\dotnet\sdk]
  2.1.505 [c:\program files\dotnet\sdk]
  7.0.102 [c:\program files\dotnet\sdk]
  7.0.203 [c:\program files\dotnet\sdk]
  8.0.100 [c:\program files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.2 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.3 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.8 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.25 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.2 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.8 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.11 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.25 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.2 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.5 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.