Skip to content

Instantly share code, notes, and snippets.

@tatelax
Created October 13, 2021 02:11
Show Gist options
  • Select an option

  • Save tatelax/b4f9cfdead6646f56662789fb21aa82d to your computer and use it in GitHub Desktop.

Select an option

Save tatelax/b4f9cfdead6646f56662789fb21aa82d to your computer and use it in GitHub Desktop.

Revisions

  1. Tate McCormick created this gist Oct 13, 2021.
    25 changes: 25 additions & 0 deletions BuildCLI.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    namespace Scripts.Utils.BuildMaker.Editor
    {
    public static class BuildCLI
    {
    // Called via editor in batchmode command line arguments
    public static void Build()
    {
    string[] args = System.Environment.GetCommandLineArgs();

    string buildProfile = null;

    for (int i = 0; i < args.Length; i++)
    {
    if (args[i] != "-buildProfile") continue;

    buildProfile = args[i + 1];
    break;
    }

    Debug.Log("Build Profile = " + buildProfile);

    Execute(AssetDatabase.LoadAssetAtPath(buildProfile, typeof(BuildProfileScriptableObject)) as BuildProfileScriptableObject);
    }
    }
    }