Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Accessing Lock state of a Package via script

Discussion in 'Package Manager' started by pojoih, Sep 29, 2020.

  1. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    I recently tried to build a system to manually trigger an update of our custom git packages via an Editor Script and found out there isn't an easy way to change the lock state of a specific git package unless parsing the packages-lock.json by myself.
    It would be cool to include the lockstate inside the PackageInfo or GitInfo class and get some functions like SetHash oder simply Update to fetch the newest Tag/Version of a package.
     
  2. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @pojoih,

    The ability to update to the newest revision of a Git package is on our roadmap but we are still working on the technical details. In the meantime, parsing the packages-lock.json file is probably the only way to do this from a script.

    Sam