Skip to content

Commit bb7b06a

Browse files
committed
feat: failsafe
1 parent b3ecbf6 commit bb7b06a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Commands/ResetCommand.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ public function handle(): int
4848
$packageJson = json_decode(file_get_contents($packageJsonPath), true);
4949
$appName = $packageJson['name'];
5050

51-
$appDataPath = $this->appDataDirectory($appName);
52-
$this->line('Clearing: '.$appDataPath);
53-
54-
if ($filesystem->exists($appDataPath)) {
55-
$filesystem->remove($appDataPath);
51+
// Eh, just in case, I don't want to delete all user data by accident.
52+
if (! empty($appName)) {
53+
$appDataPath = $this->appDataDirectory($appName);
54+
$this->line('Clearing: '.$appDataPath);
55+
56+
if ($filesystem->exists($appDataPath)) {
57+
$filesystem->remove($appDataPath);
58+
}
5659
}
5760
}
5861

0 commit comments

Comments
 (0)