Skip to content

Commit

Permalink
Try to silently import txt instead of nav files
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 30, 2013
1 parent 45f380b commit 832164b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/FakeLib/DynamicsNavHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ let private reportError text logFile =
failwith (text + (if errors = 1 then " with 1 error." else sprintf " with %d errors." errors))

let private import connectionInfo fileName =
let fi = fileInfo fileName
let fi =
let fi = fileInfo fileName
let deleteFile,fi =
if fi.Extension = ".nav" then
fi.CopyTo(Path.Combine(fi.Directory.FullName,fi.Name + ".txt"))
true,fi.CopyTo(Path.Combine(fi.Directory.FullName,fi.Name + ".txt"))
else
fi
false,fi

let args =
sprintf "command=importobjects, file=\"%s\", logfile=\"%s\", servername=\"%s\", database=\"%s\""
Expand All @@ -92,8 +92,11 @@ let private import connectionInfo fileName =
info.WorkingDirectory <- connectionInfo.WorkingDir
info.Arguments <- args) connectionInfo.TimeOut)
then
if deleteFile then fi.Delete()
reportError "ImportFile failed" connectionInfo.TempLogFile

if deleteFile then fi.Delete()

/// Imports the given txt or fob file into the Dynamics NAV client
let ImportFile connectionInfo fileName =
traceStartTask "ImportFile" fileName
Expand Down

0 comments on commit 832164b

Please sign in to comment.