learnweb / moodledocker

:whale2: This is a docker-based development environment that we are using since 2016.
GNU General Public License v3.0
7 stars 3 forks source link

moodledocker-exec does not work at all if any(!) project uses a static moodle source #5

Open Dagefoerde opened 7 years ago

Dagefoerde commented 7 years ago

If any project uses a static moodle source - instead of a symlink to some repository located elsewhere - moodledocker-exec will fail since File.readlink cannot be applied to a non-link.

home/j_dage01/Docker/Metafiles/Scripts/moodledocker-common.rb:62:in `readlink': Invalid argument @ rb_readlink - /home/j_dage01/Docker/production3_0/moodle (Errno::EINVAL)
        from /home/j_dage01/Docker/Metafiles/Scripts/moodledocker-common.rb:62:in `block in project_name'
        from /home/j_dage01/Docker/Metafiles/Scripts/moodledocker-common.rb:62:in `select'
        from /home/j_dage01/Docker/Metafiles/Scripts/moodledocker-common.rb:62:in `project_name'
        from /home/j_dage01/Docker/Metafiles/Scripts/moodledocker-exec:9:in `execute_on_docker'
        from /home/j_dage01/Docker/Metafiles/Scripts/moodledocker-exec:33:in `<main>'

a0a99e8b1a50ded86c6220b65f7261bfbdd08296 fixes this for project_path, but project_name is more complex so that the fix cannot be applied identically.

dashohoxha commented 7 years ago

I don't have any actual suggestion for fixing this problem, but have a look at my approach and maybe you will get some inspiration: