fonttools/region-flags

Symlinks don't work on Windows

Closed this issue · 12 comments

Dang apparently Bower (and npm) ignore symlinks because they don't work on Windows.

Is there a way to get all the flags without symlinks?

Donno. Any suggestions?

Including region-flags as a submodule still doesn't work on Windows because its png folder has symlinks (BL.png, BQ.png, BV.png, CP.png, DG.png, EA.png, HM.png, MF.png, SJ.png, TF.png, UM.png) which generates Warning: Command failed: identify.exe: improper image header 'region-flags/png/BL.png' @ error/png.c/ReadPNGImage/3921.. Copying the target country's file over the link gets past that error, but then the identify command (identify -verbose src/img/flags/@2x/*.png with ImageMagick 6.9.2-0 Q16 x64 2015-08-15) exits with 1...which is odd because the same command exits 0 when invoked directly. Building the images isn't a concern for me right now, but FYI.

I need suggestions as to how to proceed. @shervinafshar, can you think of any?

Can't you just duplicate the files instead of symlinking them?

We definitely can. Does "ln" fail in such situations? We can try this patch:

diff --git a/make-aliases.sh b/make-aliases.sh
index dab602a..d800c1f 100755
--- a/make-aliases.sh
+++ b/make-aliases.sh
@@ -11,7 +11,7 @@ while read from to; do
                        echo "ERROR: $f exist; skipping"
                        continue
                fi
-               ln -s "$to.$dir" "$f"
+               ln -s "$to.$dir" "$f" || cp "$dir/$to.$dir" "$f"

        done
 done < data/ALIASES

does that work for you?

No it's the symlinks that already exist in the generated files e.g. png/BL.png

Amazing thank you! Would you consider doing a release? Makes it easier to pull into other projects.

Make a 1.0 tag / release.

Thank you! Unfortunately I've just noticed the new commit is in the gh-pages branch instead of master!

I have had intended to delete the master branch before. Done now. We only have a gh-pages branch now.

Ok thanks! One last thing: for this to work with Bower, you need to use Semantic Versioning, which means the release tag needs to be called 1.0.0 - is that possible?

Ugh. Done.