Skip to content

Instantly share code, notes, and snippets.

@tatelax
Created October 13, 2021 02:11
Show Gist options
  • Save tatelax/b4f9cfdead6646f56662789fb21aa82d to your computer and use it in GitHub Desktop.
Save tatelax/b4f9cfdead6646f56662789fb21aa82d to your computer and use it in GitHub Desktop.
Build CLI
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);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment