Giter Site home page Giter Site logo

unity-changeset's Introduction

unity-changeset

Get/List Unity editor changeset

npm license downloads release semantic-release





Usage as a node module

Requirement: NodeJs 14 or later

Install

npm install unity-changeset

Import

// javascript
const { getUnityChangeset, scrapeArchivedChangesets, scrapeBetaChangesets } = require('unity-changeset');
// or, typescript
const { getUnityChangeset, scrapeArchivedChangesets, scrapeBetaChangesets } = from 'unity-changeset';

Example

const { getUnityChangeset, scrapeArchivedChangesets, scrapeBetaChangesets } = require('unity-changeset');

(async () => {
    const changeset = await getUnityChangeset('2020.1.14f1');
    console.log(changeset);
    //=> UnityChangeset {version: '2020.1.14f1', changeset: 'd81f64f5201d'}
    console.log(changeset.toString());
    //=> 2020.1.14f1     d81f64f5201d
    const changesets = await scrapeArchivedChangesets();
    console.dir(changesets);
    //=> [
    //     UnityChangeset { version: '2020.1.15f1', changeset: '97d0ae02d19d' },
    //     UnityChangeset { version: '2020.1.14f1', changeset: 'd81f64f5201d' },
    //     UnityChangeset { version: '2020.1.13f1', changeset: '5e24f28bfbc0' },
    //     ...
    //   ]
    const betaChangesets = await scrapeBetaChangesets();
    console.log(betaChangesets);
    //=> [
    //     UnityChangeset { version: '2020.2.0b13', changeset: '655e1a328b90' },
    //     UnityChangeset { version: '2020.2.0b12', changeset: '92852ae685d8' },
    //     UnityChangeset { version: '2020.2.0b11', changeset: 'c499c2bf2e80' },
    //     ...
    //   ]
})();

Usage as a deno module

const { getUnityChangeset, scrapeArchivedChangesets, scrapeBetaChangesets } = from 'https://deno.land/x/unity_changeset/src/index.ts';

// or, specific version
const { getUnityChangeset, scrapeArchivedChangesets, scrapeBetaChangesets } = from 'https://deno.land/x/[email protected]/src/index.ts';





Usage as a command-line utility

Install

# Requirement: NodeJs 14 or later
npm install -g unity-changeset

# Use without installation
npx unity-changeset ...

or

deno install -A -f -n unity-changeset https://deno.land/x/unity_changeset/src/cli.ts

Display help

$ unity-changeset -h
Usage: Get a changeset for specific version
  $ unity-changeset <version>

Usage: List changesets
  $ unity-changeset list [options]

Options:
  --min <version>     Minimum version (included)
  --max <version>     Maximum version (included)
  --grep <version>    Grep version
  --json              Output in json format
  --pretty-json       Output in pretty json format
  --all               List all changesets (alpha/beta included)
  --beta              List alpha/beta changesets
  --versions          Output only the available Unity versions
  --minor-versions    Output only the available Unity minor versions
  --latest-patch      Output only the latest Unity patch versions
  --oldest-patch      Output only the oldest Unity patch versions
  --oldest-lifecycle  Output only the latest lifecycle Unity patch versions

Get a changeset for specific version:

$ unity-changeset 2020.2.14f1
d81f64f5201d

Get a changeset for specific version

$ unity-changeset list
2020.1.14f1     d81f64f5201d
2020.1.13f1     5e24f28bfbc0
2020.1.12f1     55b56f0a86e3
...

# List changesets in json format:
$ unity-changeset list --json
[{"version":"2020.1.15f1","changeset":"97d0ae02d19d"},{"version":"2020.1.14f1","changeset":"d81f64f5201d"},...]

# List changesets in pretty json format:
$ unity-changeset list --pretty-json
[
  {
    "version": "2020.1.15f1",
    "changeset": "97d0ae02d19d"
  },
  {
    "version": "2020.1.14f1",
    "changeset": "d81f64f5201d"
  },
  ...
]

# List changesets (alpha/beta):
$ unity-changeset list --beta
2020.2.0b13     655e1a328b90
2020.2.0b12     92852ae685d8
2020.2.0b11     c499c2bf2e80
...

# List changesets (all):
$ unity-changeset list --all
2020.2.0b13     655e1a328b90
2020.2.0b12     92852ae685d8
...
2020.1.14f1     d81f64f5201d
2020.1.13f1     5e24f28bfbc0
...

# List the available Unity versions:
$ unity-changeset list --versions
2020.1.14f1
2020.1.13f1
2020.1.12f1
...

# List the available Unity versions (alpha/beta):
$ unity-changeset list --beta --versions
2020.2.0b13
2020.2.0b12
2020.2.0b11
...

# List Unity 2018.3 or later, and 2019.1 or earlier:
$ unity-changeset list --min 2018.3 --max 2019.1
2019.1.14f1     148b5891095a
...
2018.3.1f1	    bb579dc42f1d
2018.3.0f2	    6e9a27477296

# List all Unity 2018.3 versions:
$ unity-changeset list --grep 2018.3
2018.3.14f1     d0e9f15437b1
2018.3.13f1     06548a9e9582
...
2018.3.1f1	    bb579dc42f1d
2018.3.0f2	    6e9a27477296

# List the available Unity minor versions:
$ unity-changeset list --minor-versions
2020.1
...
2017.2
2017.1

# List the latest Unity patch versions:
$ unity-changeset list --latest-patch
2020.1.14f1     d81f64f5201d
...
2017.2.5f1      588dc79c95ed
2017.1.5f1      9758a36cfaa6

Install a specific version of Unity via UnityHub

# /path/to/unity/hub:
#   Windows: C:\\Program\ Files\\Unity\ Hub\\Unity\ Hub.exe
#   MacOS: /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub

# Show UnityHub help:
$ /path/to/unity/hub -- --headless help

# Install Unity 2020.1.15f1 with modules for iOS and Android:
$ /path/to/unity/hub -- --headless install \
  --version 2020.1.15f1 \
  --changeset `unity-changeset 2020.1.15f1` \
  --module ios,android





Contributing

Issues

Issues are very valuable to this project.

  • Ideas are a valuable source of contributions others can make
  • Problems show where this project is lacking
  • With a question you show where contributors can improve the user experience

Pull Requests

Pull requests are, a great way to get your ideas into this repository.

Support

This is an open source project that I am developing in my spare time.
If you like it, please support me.
With your support, I can spend more time on development. :)





License

  • MIT

Author

See Also

unity-changeset's People

Contributors

dependabot[bot] avatar mob-sakai avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unity-changeset's Issues

Deno support

At GameCI we're working on a Deno based CLI. Most dependencies are portable but not unity-changeset yet.

Describe the solution you'd like
It would be great if this dependency could be published at https://deno.land/x as well

Describe alternatives you've considered
We could also manually port it, but it would be harder to maintain

Additional context
Deno support mostly just requires you to use different imports.
There seem to be tools that compile for Deno target as well.

feature request: GitHub Action for this awesome feature

NOTE: Your issue may already be reported! Please search on the issue tracker before creating one.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Love the tool, but it would also be fantastic if it was published to the GitHub actions marketplace as a GitHub action

Keep up the great work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.