@@ -36,23 +36,27 @@ protected function configure()
3636 */
3737 protected function execute (InputInterface $ input , OutputInterface $ output )
3838 {
39- $ host = $ this ->selectHost ($ input , getenv ($ this ->config ()->get ('service.env_prefix ' ) . 'APPLICATION ' ));
4039 /** @var \Platformsh\Cli\Service\Mount $mountService */
4140 $ mountService = $ this ->getService ('mount ' );
42- if ($ host instanceof LocalHost) {
43- /** @var \Platformsh\Cli\Service\RemoteEnvVars $envVars */
44- $ envVars = $ this ->getService ( ' remote_env_vars ' );
45- $ config = ( new AppConfig ( $ envVars -> getArrayEnvVar ( ' APPLICATION ' , $ host ))) ;
41+ if (( $ applicationEnv = getenv ( $ this -> config ()-> get ( ' service.env_prefix ' ) . ' APPLICATION ' ))
42+ && !LocalHost:: conflictsWithCommandLineOptions ( $ input , $ this -> config ()-> get ( ' service.env_prefix ' ))) {
43+ $ this ->debug ( ' Selected host: localhost ' );
44+ $ config = json_decode ( base64_decode ( $ applicationEnv ), true ) ?: [] ;
4645 $ mounts = $ mountService ->mountsFromConfig ($ config );
46+ $ appName = $ config ['name ' ];
4747 } else {
48+ $ this ->validateInput ($ input );
4849 $ container = $ this ->selectRemoteContainer ($ input );
4950 $ mounts = $ mountService ->mountsFromConfig ($ container ->getConfig ());
51+ $ appName = $ container ->getName ();
5052 }
5153
54+ $ appType = strpos ($ appName , '-- ' ) !== false ? 'worker ' : 'app ' ;
55+
5256 if (empty ($ mounts )) {
53- $ this ->stdErr ->writeln (sprintf ('No mounts found on host : <info>%s</info> ' , $ host -> getLabel () ));
57+ $ this ->stdErr ->writeln (sprintf ('No mounts found on %s : <info>%s</info> ' , $ appType , $ appName ));
5458
55- return 1 ;
59+ return 0 ;
5660 }
5761
5862 if ($ input ->getOption ('paths ' )) {
@@ -70,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7074
7175 /** @var \Platformsh\Cli\Service\Table $table */
7276 $ table = $ this ->getService ('table ' );
73- $ this ->stdErr ->writeln (sprintf ('Mounts on <info>%s</info>: ' , $ host -> getLabel () ));
77+ $ this ->stdErr ->writeln (sprintf ('Mounts on %s: <info>%s</info> ' , $ appType , $ appName ));
7478 $ table ->render ($ rows , $ this ->tableHeader );
7579
7680 return 0 ;
0 commit comments