Skip to content

Commit

Permalink
Fix bug on Mite init
Browse files Browse the repository at this point in the history
  • Loading branch information
Madison Sharps committed Mar 5, 2013
1 parent 21d25e1 commit f71f285
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Mite/Mite.Console.csproj
Expand Up @@ -35,7 +35,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
12 changes: 4 additions & 8 deletions Mite/Program.cs
Expand Up @@ -106,12 +106,12 @@ static void Main(string[] args)
JObject obj = new JObject();
obj["repositoryName"] = repositoryName;
obj["connectionString"] = connectionString;
File.WriteAllText(currentDirectory, obj.ToString(Formatting.Indented));

File.WriteAllText(Path.Combine(currentDirectory , "mite.config"), obj.ToString(Formatting.Indented));
}
try
{
MigratorFactory.GetMigrator(currentDirectory);
var tmpMigrator = MigratorFactory.GetMigrator(currentDirectory);
repo = tmpMigrator.DatabaseRepository;
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
Expand All @@ -124,11 +124,7 @@ static void Main(string[] args)
Console.WriteLine("Working directory is not clean.\nPlease ensure no existing scripts or project files exist when performing init.");
return;
}
if(repo.MigrationTableExists())
{
Console.WriteLine("A _migration table already exists.\n'init' should only be used for new setups.\nSee 'mite /?' for help.");
return;
}


var baseFileName = "";
try
Expand Down

0 comments on commit f71f285

Please sign in to comment.