Skip to content

Commit

Permalink
Merge pull request #68 from enitimeago/silentifinstalled
Browse files Browse the repository at this point in the history
feat: silentIfInstalled option
  • Loading branch information
anatawa12 authored Mar 2, 2024
2 parents b6cb483 + 06f3785 commit 750c4f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Assets/InstallerSource/VPMPackageAutoInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private static async SyncedTask<bool> DoInstallImpl()

if (request.locked().Count == 0)
{
if (!IsNoPrompt())
if (!IsNoPrompt() && !config.silentIfInstalled)
EditorUtility.DisplayDialog("Nothing TO DO!", "All Packages are Installed!", "OK");
return false;
}
Expand Down Expand Up @@ -411,13 +411,15 @@ sealed class VpaiConfig
{
[NotNull] public readonly VpaiRepository[] vpmRepositories;
public readonly bool includePrerelease;
public readonly bool silentIfInstalled;
public readonly VrcGet.PartialUnityVersion minimumUnity;
[NotNull] public readonly Dictionary<string, VrcGet.VersionRange> VpmDependencies;

public VpaiConfig(JsonObj json)
{
vpmRepositories = json.Get("vpmRepositories", JsonType.List, true)?.Select(v => new VpaiRepository(v))?.ToArray() ?? Array.Empty<VpaiRepository>();
includePrerelease = json.Get("includePrerelease", JsonType.Bool, true);
silentIfInstalled = json.Get("silentIfInstalled", JsonType.Bool, true);
VpmDependencies = json.Get("vpmDependencies", JsonType.Obj, true)
?.ToDictionary(x => x.Item1, x => VrcGet.VersionRange.Parse((string)x.Item2))
?? new Dictionary<string, VrcGet.VersionRange>();
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ will make unitypackage for AvatarOptimizer 0.2.x
// by default, beta releases are not allowed.
// to allow all beta versions in that range, please make this true
"includePrerelease": false,
// For advanced usage only. This will suppress the prompt to users if dependencies are already installed.
// It is strongly recommended you keep this as the default false, otherwise users may be confused why nothing happened.
// This should only enabled in certain use cases, for example if you are distributing with other assets
"silentIfInstalled": false,
// If you want to disallow unity version lower than specific version, you can specify it here.
// Regardless if this is not specified, unity version will be checked by VPM.
"minimumUnity": "2022.3"
Expand Down

0 comments on commit 750c4f0

Please sign in to comment.