Skip to content

Commit aa1e441

Browse files
committed
fix version number replace method
- quotes were causing a problem, just replace {Version} tag instead of whole line - forgot to add return type to mel function
1 parent 2547fcd commit aa1e441

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ global proc unitySetupUI(){
3333
evalDeferred -lowestPriority "unityInstallUI";
3434
}
3535

36-
global proc unitySetLabelVersion(string $label){
36+
global proc string unitySetLabelVersion(string $label){
3737
global string $unityPluginVersion;
3838
return `format -stringArg $label -stringArg $unityPluginVersion "^1s (v.^2s)"`;
3939
}

CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ add_custom_target(
9494

9595
###########################################################################
9696
# Add target to replace the unity package version number in files
97-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
98-
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
99-
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
100-
set(VERSION_AS_STRING "'${PACKAGE_VERSION}'")
101-
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
102-
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
103-
endif()
104-
105-
10697
set(README_TARGET readme_replace)
10798
add_custom_target(
10899
${README_TARGET}
@@ -114,8 +105,8 @@ add_custom_target(
114105
COMMAND ${PYTHON_EXECUTABLE}
115106
"${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
116107
"${CMAKE_SOURCE_DIR}/Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel"
117-
".*global string $unityPluginVersion.*=.*"
118-
"global string $unityPluginVersion = ${VERSION_AS_STRING};"
108+
"{Version}"
109+
"${PACKAGE_VERSION}"
119110
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
120111
COMMENT "Replacing version number in files with ${PACKAGE_VERSION}"
121112
)

0 commit comments

Comments
 (0)