HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.24k stars 2.29k forks source link

serve_local_files.sh needs to escape slashes before writing to files.txt #4437

Open ruzko opened 1 year ago

ruzko commented 1 year ago

Describe the bug Lines in files.txt lack a slash between port number and filename

To Reproduce Steps to reproduce the behavior:

  1. serve local files using serve_local_files.sh
  2. inspect files.txt
  3. observe the missing slash e.g: http://localhost:8081images/OIF-e2bexWrojgtQnAPPcUfOWQ.jpeg

Expected behavior Lines are formatted as proper URLs, e.g. http://localhost:8081/images/OIF-e2bexWrojgtQnAPPcUfOWQ.jpeg

to achieve this, I edited line 23 from eval $FIND_CMD | sed "/${INPUT_DIR_ESCAPED}/s//http:\/\/localhost:${PORT}/" > $OUTPUT_FILE to eval $FIND_CMD | sed "/${INPUT_DIR_ESCAPED}/s//http:\/\/localhost:${PORT}\/" > $OUTPUT_FILE

Screenshots

Environment (please complete the following information):

Additional context I'll open a pull request over the weekend

ruzko commented 1 year ago

Now the original version works, and mine produces double slashes // instead. I've got some undefined behaviour here, maybe it's just my environment...

ruzko commented 1 year ago

The original seems to work now, so it was probably something on my side. Should I close or delete the issue?