Mojang / minecraft-scripting-libraries

Sets of typescript scripting libraries for use with the minecraft scripting modules.
MIT License
17 stars 2 forks source link

Add `clean` support for `Custom` deployment paths #32

Open ChristopherHaws opened 2 months ago

ChristopherHaws commented 2 months ago

The current implementation of STANDARD_CLEAN_PATHS does not have support for the CUSTOM_DEPLOYMENT_PATH environment variable which is used when MINECRAFT_PRODUCT="Custom". This change switches the logic to use the existing getGameDeploymentRootPaths helper method to better generate the clean paths.

This change makes clean work out of the box on linux, as shown here:

chaws@pc:~/dev/mc/bedrock-sample$ pnpm local-deploy

> bedrock-sample@1.0.0 local-deploy /home/chaws/dev/mc/bedrock-sample
> just-scripts local-deploy

[9:31:06 PM] ■ started 'local-deploy'
[9:31:06 PM] ■ started 'clean-local'
Cleaning temp
Cleaning lib
Cleaning dist
[9:31:06 PM] ■ finished 'clean-local' in 0s
[9:31:06 PM] ■ started 'build'
[9:31:06 PM] ■ started 'typescript'
[9:31:06 PM] ■ Running /home/chaws/dev/mc/bedrock-sample/node_modules/typescript/lib/tsc.js with /home/chaws/dev/mc/bedrock-sample/tsconfig.json
[9:31:06 PM] ■ Executing: "/home/chaws/.local/share/pnpm/nodejs/20.12.0/bin/node" "/home/chaws/dev/mc/bedrock-sample/node_modules/typescript/lib/tsc.js" --project "/home/chaws/dev/mc/bedrock-sample/tsconfig.json"
[9:31:07 PM] ■ finished 'typescript' in 0.73s
[9:31:07 PM] ■ started 'bundle'
[9:31:07 PM] ■ finished 'bundle' in 0.07s
[9:31:07 PM] ■ finished 'build' in 0.8s
[9:31:07 PM] ■ started 'package'
[9:31:07 PM] ■ started 'clean-collateral'
Proceeding without APPDATA on this platform. File copy will fail if APPDATA is required.
Proceeding without LOCALAPPDATA on this platform. File copy will fail if LOCALAPPDATA is required.
Cleaning directory /home/chaws/.local/share/mcpelauncher/games/com.mojang/development_behavior_packs/bedrock_sample.
Cleaning directory /home/chaws/.local/share/mcpelauncher/games/com.mojang/development_resource_packs/bedrock_sample.
[9:31:07 PM] ■ finished 'clean-collateral' in 0.01s
[9:31:07 PM] ■ started 'copyArtifacts'
Copying folder /home/chaws/dev/mc/bedrock-sample/behavior_packs/bedrock_sample to /home/chaws/.local/share/mcpelauncher/games/com.mojang/development_behavior_packs/bedrock_sample
Copying folder /home/chaws/dev/mc/bedrock-sample/dist/scripts to /home/chaws/.local/share/mcpelauncher/games/com.mojang/development_behavior_packs/bedrock_sample/scripts
Copying folder /home/chaws/dev/mc/bedrock-sample/resource_packs/bedrock_sample to /home/chaws/.local/share/mcpelauncher/games/com.mojang/development_resource_packs/bedrock_sample
[9:31:07 PM] ■ finished 'copyArtifacts' in 0.01s
[9:31:07 PM] ■ finished 'package' in 0.01s
[9:31:07 PM] ■ finished 'local-deploy' in 0.83s