这可以通过post-link
配方中的脚本来完成。 如文档中所述,您必须将消息写入${PREFIX}/.messages.txt
,而不是stdout
或stderr
。
示例配方:
foobar-recipe/
├── meta.yaml
├── post-link.bat
└── post-link.sh
# meta.yaml
package:
name: foobar
version: 0.1
#!/bin/bash
# post-link.sh
cat << EOF >> ${PREFIX}/.messages.txt
*****************************
Thanks for installing foobar!
*****************************
EOF
(对于 Windows,实现post-link.bat
。)
构建它:
$ conda build foobar-recipe
测试安装:
$ conda create -y -n test-foobar --use-local foobar
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/miniconda/envs/test-foobar
added / updated specs:
- foobar
The following NEW packages will be INSTALLED:
foobar opt/miniconda/conda-bld/osx-64::foobar-0.1-0
Preparing transaction: done
Verifying transaction: done
Executing transaction: /
*****************************
Thanks for installing foobar!
*****************************
done
#
# To activate this environment, use
#
# $ conda activate test-foobar
#
# To deactivate an active environment, use
#
# $ conda deactivate