Skip to content

Commit e94ae10

Browse files
committed
Download npm packages only if necessary
This makes CodeCompass installation process faster. Fixes #456
1 parent 6dfc28a commit e94ae10

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

webgui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ install(CODE "set(CC_PACKAGE \"${CMAKE_CURRENT_SOURCE_DIR}/package.json\")")
1818
install(CODE "set(CC_PROFILE \"${CMAKE_CURRENT_SOURCE_DIR}/codecompass.profile.js.in\")")
1919
install(CODE "set(INSTALL_SCRIPTS_DIR \"${INSTALL_WEBROOT_DIR}/scripts/\")")
2020
install(CODE "set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})")
21-
install(SCRIPT InstallGUI.cmake)
21+
install(SCRIPT InstallGUI.cmake)

webgui/InstallGUI.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ execute_process(
44
COMMAND cp ${CC_PACKAGE} ${INSTALL_SCRIPTS_DIR}/package.json
55
WORKING_DIRECTORY ${INSTALL_SCRIPTS_DIR})
66

7-
execute_process(
8-
COMMAND npm install
9-
WORKING_DIRECTORY ${INSTALL_SCRIPTS_DIR})
7+
if(${CC_PACKAGE} IS_NEWER_THAN ${INSTALL_SCRIPTS_DIR}/package.json)
8+
execute_process(
9+
COMMAND npm install
10+
WORKING_DIRECTORY ${INSTALL_SCRIPTS_DIR})
11+
endif()
1012

1113
execute_process(
1214
COMMAND ${CMAKE_COMMAND} -E create_symlink dojo-util node_modules/util
@@ -39,4 +41,4 @@ execute_process(
3941
# The build-report may leak sensitive information
4042
file(REMOVE ${INSTALL_SCRIPTS_DIR}/release/build-report.txt)
4143

42-
message("The Dojo Build System finished.")
44+
message("The Dojo Build System finished.")

0 commit comments

Comments
 (0)