diff --git a/app/assets/remote_scripts/macos.sh b/app/assets/remote_scripts/macos.sh index a24fc251..4632d421 100644 --- a/app/assets/remote_scripts/macos.sh +++ b/app/assets/remote_scripts/macos.sh @@ -1,6 +1,10 @@ #!/bin/bash -# CodeOcean Remote Client v0.5 +# run like this: +# cd path/to/project_root +# .scripts/macos.sh . + +# CodeOcean Remote Client v0.6 #file_info format: = (src/frog.java=34) #file_path format: @@ -28,6 +32,7 @@ function get_valid_file_path { function get_escaped_file_content { file_path="$1" cat "$file_path" | + perl -p -e 's@\\@\\\\@g' | perl -p -e 's@\r\n@\\n@g' | perl -p -e 's@\n@\\n@g' | perl -p -e 's@"@\\"@g' diff --git a/app/assets/remote_scripts/ubuntu.sh b/app/assets/remote_scripts/ubuntu.sh index 8c56f820..db5a970d 100644 --- a/app/assets/remote_scripts/ubuntu.sh +++ b/app/assets/remote_scripts/ubuntu.sh @@ -1,6 +1,10 @@ #!/bin/bash -# CodeOcean Remote Client v0.5 +# run like this: +# cd path/to/project_root +# .scripts/ubuntu.sh . + +# CodeOcean Remote Client v0.6 #file_info format: = (src/frog.java=34) #file_path format: @@ -27,6 +31,7 @@ function get_valid_file_path { function get_escaped_file_content { file_path="$1" cat "$file_path" | + perl -p -e 's@\\@\\\\@g' | perl -p -e 's@\r\n@\\n@g' | perl -p -e 's@\n@\\n@g' | perl -p -e 's@"@\\"@g' diff --git a/app/assets/remote_scripts/windows.ps1 b/app/assets/remote_scripts/windows.ps1 index 3d0ce539..9647d2e5 100644 --- a/app/assets/remote_scripts/windows.ps1 +++ b/app/assets/remote_scripts/windows.ps1 @@ -1,6 +1,8 @@ -# run like this: powershell.exe -noprofile -executionpolicy bypass -file path\to\client_script.ps1 path\to\project_root +# run like this: +# cd path\to\project_root +# powershell.exe -noprofile -executionpolicy bypass -file .scripts\windows.ps1 . -# CodeOcean Remote Client v0.5 +# CodeOcean Remote Client v0.6 #file_info format: = (src/frog.java=34) #file_path format: @@ -57,6 +59,7 @@ function get_file ($file_path){ function get_escaped_file_content ($file){ $content = [IO.File]::ReadAllText($file.fullname) + $content = $content.replace('\', '\\') $content = $content -replace "`r`n", '\n' $content = $content -replace "`n", '\n' $content = $content.replace('"', '\"')