core icon indicating copy to clipboard operation
core copied to clipboard

Running dlang-tour offline is broken

Open wilzbach opened this issue 8 years ago • 5 comments

With these commands:

dub fetch dlang-tour
dub run dlang-tour

one gets:

Compiling diet template 'tour.dt'...
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dlang-tour...
Running ../../../.dub/packages/dlang-tour-1.0.1/dlang-tour/dlang-tour 
Error loading config file 'config.yml'. Falling back to defaults: dyaml.exception.YAMLException@../../../.dub/packages/dyaml-0.5.3/dyaml/source/dyaml/loader.d(138): Unable to open file config.yml for YAML loading: config.yml: No such file or directory
std.file.FileException@std/file.d(3441): public/content: No such file or directory

well yes - I didn't ran it in my local fork, but any other user wouldn't have this fork neither, so maybe we should add some logic to search for the root source directory?

wilzbach avatar Aug 15 '16 00:08 wilzbach

Damn I must have tried that in my local dlang-tour directory. Is there something in dub that lets you copy or package external files so that the run command works out of the box? I mean dub already clones the repository but it doesn't seem to change the working directory to the correct folder...

stonemaster avatar Aug 15 '16 06:08 stonemaster

Is there something in dub that lets you copy or package external files so that the run command works out of the box? I mean dub already clones the repository but it doesn't seem to change the working directory to the correct folder...

Not that I would know of. The best you can do is probably using the output of dub describe dlang-tour

wilzbach avatar Aug 15 '16 15:08 wilzbach

this might be related to #461 which is about giving the user control to set the content directory.

wilzbach avatar Aug 21 '16 17:08 wilzbach

Hmm, we still have this issue as dub fetch doesn't fetch the git submodules automatically, see e.g. https://github.com/dlang/dub/issues/1044

Probably the best way to deal with this, would be have a behavior if public/content can't be found similar to this:

  • download and extract the respective zip files of the submodules (parsed from .gitmodules) to a user directory (e.g. ~/.config/dlang-tour/languages)
  • store the latest version for each version within the folder
  • if the last run was more than 7 days ago and there's a internet connection, try to update the zip folders (in the background and automatically refresh the content - without any user interaction)

wilzbach avatar Jun 05 '17 03:06 wilzbach

For now, a simple and less technical workaround I am using:

#suppose I want to run dlang-tour with english language:
cd ~/.dub/packages/dlang-tour-1.0.6/dlang-tour
git clone https://github.com/dlang-tour/english.git 
dub run dlang-tour -- --lang-dir english

biocyberman avatar Jul 07 '17 10:07 biocyberman