setName('files:mount:refresh') ->setDescription('Refresh the list of mounts for a user') ->addArgument('user', InputArgument::REQUIRED, 'User to refresh mounts for'); } public function execute(InputInterface $input, OutputInterface $output): int { $userId = $input->getArgument('user'); $user = $this->userManager->get($userId); if (!$user) { $output->writeln("User $userId not found"); return 1; } $mounts = $this->mountProviderCollection->getMountsForUser($user); $mounts[] = $this->mountProviderCollection->getHomeMountForUser($user); $this->userMountCache->registerMounts($user, $mounts); $output->writeln('Registered ' . count($mounts) . ' mounts'); return 0; } }