Skip to content

Commit

Permalink
Fix AppData command-line option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwindalmir committed Oct 12, 2021
1 parent e2a8919 commit 2621969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions WorkshopToolCommon/Options/OptionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ public abstract class OptionBase
#endif
public bool ModIO { get; set; } = false;

#if SE
[Option("appdata", Default = "%AppData%\\SpaceEngineers", HelpText = "Specify custom AppData location")]
#else
[Option("appdata", Default = "%AppData%\\MedievalEngineers", HelpText = "Specify custom AppData location")]
#endif
public string AppData { get; set; }

[Option('f', "force", Default = false, HelpText = "Force operation. USE WITH CAUTION! (not valid everywhere)")]
Expand Down
4 changes: 2 additions & 2 deletions WorkshopToolCommon/Options/ProcessedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public ProcessedOptions(OptionBase options)
{
Type = options.GetType();
ModIO = options.ModIO;
AppData = options.AppData;
AppData = Environment.ExpandEnvironmentVariables(options.AppData);
Force = options.Force;
}

Expand All @@ -230,7 +230,7 @@ public ProcessedOptions(LegacyOptions options)
Type = typeof(CloudVerb);

ModIO = options.ModIO;
AppData = options.AppData;
AppData = Environment.ExpandEnvironmentVariables(options.AppData);
Force = options.Force;

UpdateOnly = options.UpdateOnly;
Expand Down

0 comments on commit 2621969

Please sign in to comment.