Skip to content

Commit

Permalink
Merge pull request #5 from jeci-sarl/master
Browse files Browse the repository at this point in the history
🪲 Try write permission need to create DotFimDir BEFORE creating new state
  • Loading branch information
evrignaud committed Nov 13, 2015
2 parents 2c9e1c6 + 990c6a6 commit 0c17e6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/fim/command/InitCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public FimReposConstraint getFimReposConstraint()
@Override
public Object execute(Context context) throws Exception
{
if (!Files.isWritable(context.getRepositoryDotFimDir()) && !Files.isWritable(context.getRepositoryRootDir())) {
Logger.error(String.format("Not able to create the '%s' directory that holds the Fim repository", context.getRepositoryDotFimDir()));
throw new RepositoryCreationException();
}

if (context.getComment().length() == 0)
{
System.out.println("No comment provided. You are going to initialize your repository using the default comment.");
Expand Down

0 comments on commit 0c17e6c

Please sign in to comment.