Skip to content

Commit 892a8eb

Browse files
committed
Check for working directory permissions before starting init
1 parent 77fbe2a commit 892a8eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Command/InitCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
6262
}
6363
}
6464

65+
// Make sure the working directory is writable
66+
if (!is_writable(GITIFY_WORKING_DIR)) {
67+
$output->writeln('<error>Error: the current directory is not writable!</error> Please check the directory\'s permissions.');
68+
return 1;
69+
}
70+
6571
$helper = $this->getHelper('question');
6672

6773
// Where we'll store the configuration

0 commit comments

Comments
 (0)