mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
850 B
850 B
| category | layout | mirrorid |
|---|---|---|
| help | help | dart-pub |
Pub 镜像安装帮助
Pub 是 Dart 官方的包管理器。跨平台的前端应开发 框架 Flutter 也基于 Dart 并且可以使用大部分 Pub 中的 库。
如果希望通过 TUNA 的 pub 镜像安装软件,只需要设置 PUB_HOSTED_URL 这个环境变量指向 https://{{ site.host }}/dart-pub/ 即可。
以 bash 为例,临时使用 TUNA 的镜像来安装依赖:
$ PUB_HOSTED_URL="https://{{ site.host }}/dart-pub/" pub get # pub
$ PUB_HOSTED_URL="https://{{ site.host }}/dart-pub/" flutter packages get # flutter
若希望长期使用 TUNA 镜像:
$ echo 'export PUB_HOSTED_URL="https://{{ site.host }}/dart-pub/"' >> ~/.bashrc