Use folders_path config option to create the tmo dir when it is set. Fixes #485
This commit is contained in:
parent
99c148883e
commit
c235248078
|
@ -83,7 +83,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public override bool Fetch ()
|
public override bool Fetch ()
|
||||||
{
|
{
|
||||||
this.git = new SparkleGit (SparkleConfig.DefaultConfig.TmpPath,
|
this.git = new SparkleGit (base.target_folder,
|
||||||
"clone " +
|
"clone " +
|
||||||
"--progress " + // Redirects progress stats to standarderror
|
"--progress " + // Redirects progress stats to standarderror
|
||||||
"\"" + base.remote_url + "\" " + "\"" + base.target_folder + "\"");
|
"\"" + base.remote_url + "\" " + "\"" + base.target_folder + "\"");
|
||||||
|
@ -270,6 +270,7 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class SparkleGit : Process {
|
public class SparkleGit : Process {
|
||||||
|
|
||||||
public SparkleGit (string path, string args) : base ()
|
public SparkleGit (string path, string args) : base ()
|
||||||
|
|
|
@ -33,11 +33,9 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public static SparkleConfig DefaultConfig = new SparkleConfig (ConfigPath, "config.xml");
|
public static SparkleConfig DefaultConfig = new SparkleConfig (ConfigPath, "config.xml");
|
||||||
|
|
||||||
|
|
||||||
public string FullPath;
|
public string FullPath;
|
||||||
|
|
||||||
public string HomePath = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
|
public string HomePath = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
|
||||||
public string TmpPath;
|
|
||||||
|
|
||||||
public string FoldersPath {
|
public string FoldersPath {
|
||||||
get {
|
get {
|
||||||
|
@ -48,11 +46,16 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string TmpPath {
|
||||||
|
get {
|
||||||
|
return Path.Combine (FoldersPath, ".tmp");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public SparkleConfig (string config_path, string config_file_name)
|
public SparkleConfig (string config_path, string config_file_name)
|
||||||
{
|
{
|
||||||
FullPath = System.IO.Path.Combine (config_path, config_file_name);
|
FullPath = System.IO.Path.Combine (config_path, config_file_name);
|
||||||
TmpPath = Path.Combine (FoldersPath, ".tmp");
|
|
||||||
|
|
||||||
if (!Directory.Exists (config_path)) {
|
if (!Directory.Exists (config_path)) {
|
||||||
Directory.CreateDirectory (config_path);
|
Directory.CreateDirectory (config_path);
|
||||||
|
|
|
@ -162,7 +162,7 @@ namespace SparkleLib {
|
||||||
//file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
//file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
||||||
// FileAccessPermissions.UserWrite); TODO
|
// FileAccessPermissions.UserWrite); TODO
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking " + host);
|
SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking for " + host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -992,9 +992,6 @@ namespace SparkleShare {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Directory.Move (tmp_folder, target_folder_path);
|
Directory.Move (tmp_folder, target_folder_path);
|
||||||
} catch (Exception e) {
|
|
||||||
SparkleHelpers.DebugInfo ("Controller", "Error moving folder: " + e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
SparkleConfig.DefaultConfig.AddFolder (target_folder_name, this.fetcher.RemoteUrl, backend);
|
SparkleConfig.DefaultConfig.AddFolder (target_folder_name, this.fetcher.RemoteUrl, backend);
|
||||||
AddRepository (target_folder_path);
|
AddRepository (target_folder_path);
|
||||||
|
@ -1009,6 +1006,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
if (Directory.Exists (tmp_path))
|
if (Directory.Exists (tmp_path))
|
||||||
Directory.Delete (tmp_path, true);
|
Directory.Delete (tmp_path, true);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
SparkleHelpers.DebugInfo ("Controller", "Error moving folder: " + e.Message);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue