Is it possible to do some “if Windows”, “if Linux” checks, etc. in the shards.yaml file ?
(to avoid unnecessary downloads, depending upon the platforms, i.e. : to allow platform-specific installations) ?
Is it possible to do some “if Windows”, “if Linux” checks, etc. in the shards.yaml file ?
(to avoid unnecessary downloads, depending upon the platforms, i.e. : to allow platform-specific installations) ?
Short answer, not really.
Thank you !
Maybe you can compile this C code and call it from Crystal, if not possible in Crystal itself?:
#include <stdio.h>
#if defined(_WIN32) || defined(_WIN64)
const char* os = "Windoze";
#else
#ifdef __linux
const char* os = "Linux";
#else
const char* os = "Unknown";
#endif
#endif
int main(void)
{
printf("os = %s\n", os);
return 0;
}
Thank you, but the shards.yml itself is not Crystal code!
On the other hand, with the new browser, there’s no need anymore for a different .yml file per platform. The dependencies are again the same on all platforms (so, problem solved).