gmdotnet / composer-copy-file
Composer 脚本在安装或更新后复制您的目录和文件
0.3.0
2017-08-29 07:20 UTC
Requires
- php: >=5.3.3
Requires (Dev)
- composer/composer: 1.0.*@dev
- mikey179/vfsstream: ~1
- phpunit/phpunit: ~5.0
- symfony/filesystem: ~2.7
- symfony/finder: ~2.7
This package is auto-updated.
Last update: 2024-08-29 04:25:38 UTC
README
Composer 脚本在安装后复制您的文件。支持复制整个目录、单个文件和复杂的嵌套目录。
例如复制字体
{
"require":{
"twbs/bootstrap": "~3.3",
"gmdotnet/composer-copy-file": "~0.3"
},
"scripts": {
"post-install-cmd": [
"GMdotnet\\CopyFile\\ScriptHandler::copy"
],
"post-update-cmd": [
"GMdotnet\\CopyFile\\ScriptHandler::copy"
]
},
"extra": {
"copy-file": {
"vendor/twbs/bootstrap/fonts/": "web/fonts/"
}
}
}
用例
在使用最后一个斜杠时需要小心。文件目标与目录目标在斜杠处不同。
源目录层次结构
dir/
subdir/
file1.txt
file2.txt
.filehidden
-
目录到目录
{ "extra": { "copy-file": { "dir/subdir/": "web/other/" } } }
结果
web/ other/ file1.txt file2.txt .filehidden
-
文件到目录
{ "extra": { "copy-file": { "dir/subdir/file1.txt": "web/other/" "dir/subdir/file2.txt": "web/other/file2.txt/" } } }
结果
web/ other/ file1.txt file2.txt/ file2.txt
-
文件到文件
{ "extra": { "copy-file": { "dir/subdir/file1.txt": "web/other/file1.txt" "dir/subdir/file2.txt": "web/other/file_rename.txt" } } }
结果
web/ other/ file1.txt file_rename.txt
致谢
感谢 Slowprog 提供基础项目 - https://github.com/slowprog
Giuseppe Morelli - giuseppemorelli.net