Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Execute function by Command Line not working

Discussion in 'External Tools' started by cgwong, Jun 24, 2020.

  1. cgwong

    cgwong

    Joined:
    Nov 13, 2019
    Posts:
    4
    I want to add my config files to unity with jenkins, and use unity commands to generate meta files, so I used shell commands like this ( Python language):

    Code (CSharp):
    1. command = [UNITY_PATH, "-batchmode -projectPath", PROJECT_PATH, "-executeMethod Editor_Test.TestReimportScript"]
    2. subprocess.call(command, shell=True)
    Code (CSharp):
    1.     static void TestReimportScript()
    2.     {
    3.         string pathRsc = "xxx";
    4.         AssetDatabase.ImportAsset(pathRsc, ImportAssetOptions.ImportRecursive);
    5.         UnityEngine.Debug.Log(" =Done= ");
    6.     }
    After I add some new files, shell commands works fine but no new meta files were created, " =Done= " also not printed.

    So, Anyone knows why ImportAsset has no effect ?
     
unityunity