overtrue / laravel-lang

:earth_asia: 75 languages support for Laravel application.
MIT License
1.27k stars 146 forks source link

MAC使用php artisan lang:publish zh-CN 报错 #41

Closed richarduncle closed 5 years ago

richarduncle commented 5 years ago

chenjinhaodeMacBook-Pro:rarone_watch chenjinhao$ php artisan lang:publish zh-CN

cp: /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/src/zh-CN /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/json/zh-CN.json: No such file or directory

published languages (no overwrite): ["zh-CN"].

overtrue commented 5 years ago

确认一下 /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/src/zh-CN/Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/json/zh-CN.json 是否存在

richarduncle commented 5 years ago

image image

richarduncle commented 5 years ago

手动cp出来和命令发布出来一样吗? 要不我直接复制出来好了?

overtrue commented 5 years ago

@richarduncle 你在这行下面:https://github.com/overtrue/laravel-lang/blob/master/src/Commands/Publish.php#L108

加一个:

$process->getCommandLine(); 并且打印一下结果看看
richarduncle commented 5 years ago

image image

overtrue commented 5 years ago

@richarduncle 肯定是在 $process 定义后调用。。。108行删掉。。。

richarduncle commented 5 years ago

image php artisan lang:publish zh-CN 结果 "'cp' '-rn' '/Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/src/zh-CN /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/json/zh-CN.json' '/Applications/MAMP/htdocs/rarone_watch/resources/lang/'"

overtrue commented 5 years ago

OK 我明白了

overtrue commented 5 years ago

107 - 109 改为:

$files = implode(' ', \array_map('escapeshellarg', $files));
$targetPath = escapeshellarg($targetPath);
$process = Process::fromShellCommandline("cp -r{$force} {$files} {$targetPath}");
richarduncle commented 5 years ago

chenjinhaodeMacBook-Pro:rarone_watch chenjinhao$ php artisan lang:publish zh-CN

In Publish.php line 109:

Call to undefined method Symfony\Component\Process\Process::fromShellCommandline()

overtrue commented 5 years ago

composer update symfony/process

ChenRuihua commented 5 years ago

3.0.14版,107-109改成如上后,报错如图。

xnip2019-01-22_12-50-32
overtrue commented 5 years ago

@ChenRuihua No space left... 磁盘满了兄弟

ChenRuihua commented 5 years ago

并没有。

xnip2019-01-22_12-55-07
ChenRuihua commented 5 years ago

@overtrue 老眼昏花看串行了。确实满了。老大。见笑了。看错成disk0s2了。原来项目在disk0s1上呀。晕倒。