Skip to content

Commit d527097

Browse files
committed
still trying to fix the vampire build in github actions
1 parent 939aac4 commit d527097

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

patchVampireInteractive.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,25 @@ fi
247247
RAND_PATH="$ROOT_DIR/Lib/Random.hpp"
248248
if [[ -f "$RAND_PATH" ]]; then
249249
if grep -q "resetSeed" "$RAND_PATH" && ! grep -q "systemSeed" "$RAND_PATH"; then
250-
python - <<PY
250+
RAND_PATH="$RAND_PATH" python - <<'PY'
251251
from pathlib import Path
252-
path = Path(r"$RAND_PATH")
252+
import os
253+
path = Path(os.environ["RAND_PATH"])
253254
text = path.read_text()
254-
insert = \"\"\" inline static unsigned systemSeed()\\n {\\n#ifdef __EMSCRIPTEN__\\n try {\\n return std::random_device()();\\n } catch (...) {\\n return static_cast<unsigned>(std::time(nullptr));\\n }\\n#else\\n return std::random_device()();\\n#endif\\n }\\n\\n\"\"\"
255+
insert = (
256+
" inline static unsigned systemSeed()\\n"
257+
" {\\n"
258+
"#ifdef __EMSCRIPTEN__\\n"
259+
" try {\\n"
260+
" return std::random_device()();\\n"
261+
" } catch (...) {\\n"
262+
" return static_cast<unsigned>(std::time(nullptr));\\n"
263+
" }\\n"
264+
"#else\\n"
265+
" return std::random_device()();\\n"
266+
"#endif\\n"
267+
" }\\n\\n"
268+
)
255269
old = " inline static void resetSeed ()\\n {\\n setSeed(std::random_device()());\\n }\\n"
256270
new = " inline static void resetSeed ()\\n {\\n setSeed(systemSeed());\\n }\\n"
257271
if old in text:

0 commit comments

Comments
 (0)