unity-cli-utils
Advanced tools
+2
-2
| { | ||
| "name": "unity-cli-utils", | ||
| "version": "0.0.5", | ||
| "version": "0.0.6", | ||
| "description": "Unity Cli Utils", | ||
| "license": "MIT", | ||
| "main": "./src/index.js", | ||
| "gitHead": "0d5633363d3d636aae026944bc0282f92c2a96e6" | ||
| "gitHead": "6534d74884f4a0a320c07e90e6924b0c82386fdb" | ||
| } |
+43
-1
@@ -0,3 +1,45 @@ | ||
| const path = require('path'); | ||
| const ARGS_OPTIONS = { | ||
| permissive: true | ||
| }; | ||
| const ARGS = { | ||
| '--build': String, | ||
| '--version': String, | ||
| // Aliases | ||
| '--help': Boolean, | ||
| }; | ||
| const PROJECT_PATH = path.resolve('.'); | ||
| const BUILD_PATH = `${PROJECT_PATH}/.builds`; | ||
| const OS_COMMAND_MAPPER = { | ||
| macos: `-buildOSXUniversalPlayer ${BUILD_PATH}/MacOS/game`, | ||
| windows: `-buildWindows64Player ${BUILD_PATH}/Windows/game` | ||
| }; | ||
| const getUnityPath = (unityVersion) => { | ||
| return `/Applications/Unity/Hub/Editor/${unityVersion}/Unity.app/Contents/MacOS/Unity`; | ||
| } | ||
| const buildCommand = (os, unityVersion) => { | ||
| const unityPath = getUnityPath(unityVersion); | ||
| return `${unityPath} -quit -batchmode -logFile stdout.log -projectPath ${PROJECT_PATH} ${OS_COMMAND_MAPPER[os]}` | ||
| } | ||
| module.exports = { | ||
| ARGS, | ||
| ARGS_OPTIONS, | ||
| OS_COMMAND_MAPPER, | ||
| // paths | ||
| PROJECT_PATH, | ||
| BUILD_PATH, | ||
| // functions | ||
| buildCommand, | ||
| getUnityPath | ||
| } |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2207
72.96%33
3200%0
-100%