Skip to content

Commit

Permalink
Fix slugish
Browse files Browse the repository at this point in the history
  • Loading branch information
rsp4jack committed Jan 31, 2024
1 parent d815125 commit 5e39f54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/群友提交/cmake/CheckLoserHomeWork.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function(get_homework_target_name question_index cpp_file_path _target_name)
is_valid_target_name("${file_name}" ret)
if (NOT ret)
slugify("${file_name}" slug)
message(NOTICE "not valid target name: ${question_index}_${file_name}, use: ${slug}")
message(NOTICE "not valid target name: ${file_name}, use: ${slug}")
set(target_name "${question_index}_${slug}")
else ()
set(target_name "${question_index}_${file_name}")
Expand Down
3 changes: 2 additions & 1 deletion src/群友提交/cmake/Slugify.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ function(slugify str _retname)
string(MD5 strhash ${str})
file(WRITE ${CMAKE_BINARY_DIR}/slugify-${strhash}.txt "${str}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "-m" "slugify" "--stdin"
COMMAND ${Python_EXECUTABLE} "-m" "slugify" "--stdin"
TIMEOUT 10
INPUT_FILE ${CMAKE_BINARY_DIR}/slugify-${strhash}.txt
OUTPUT_VARIABLE sluggish
COMMAND_ERROR_IS_FATAL ANY
)
string(STRIP ${sluggish} sluggish)
set(${_retname} ${sluggish} PARENT_SCOPE)
endfunction()

0 comments on commit 5e39f54

Please sign in to comment.