# This sets the install path when you do `crystal deps`.
# It needs to be an absoluete path, not a relative path.
export SHARDS_INSTALL_PATH="$PWD/my/dir"
# This is needed for the Crystal compiler to the find the shards.
# The Crystal compiler does not use SHARDS_INSTAL_PATH.
# Unlike SHARDS_INSTALL_PATH, it can be a relative path.
# You must also specify the place for the Crystal source directory
# in order to find the Standard Lib .cr files:
export CRYSTAL_PATH="$SHARDS_INSTALL_PATH:the/crystal/src"
# Now you can do:
crystal deps # uses SHARDS_INSTALL_PATH
crystal build src/my-file.cr # uses CRYSTAL_PATH
2 回答
看来你可以设置一个环境变量
SHARDS_INSTALL_PATH
. 然而,这没有记录,应小心处理 .为什么还需要不同的安装目录?
来源:试错法和grep-ing shards和Crystal的源代码 .
注意:正如Johannes Müller先前所述,这是无证件的 .