Переглянути джерело

#821: Checking for existence of ".git" folder to allow for cloning example repo into empty target folder.

Thomas Kutz 9 роки тому
батько
коміт
532b5b7f83

+ 8 - 1
plugins/org.yakindu.sct.examples.wizard/src/org/yakindu/sct/examples/wizard/service/git/GitRepositoryExampleService.java

@@ -58,6 +58,8 @@ import com.google.inject.name.Named;
 @Singleton
 public class GitRepositoryExampleService implements IExampleService {
 
+	private static final String GIT_METADATA_FOLDER = ".git";
+
 	private static final String METADATA_JSON = "metadata.json";
 
 	private static final String RELEASE = "release";
@@ -72,10 +74,15 @@ public class GitRepositoryExampleService implements IExampleService {
 		return java.nio.file.Paths.get(ExampleActivator.getDefault().getPreferenceStore()
 				.getString(ExamplesPreferenceConstants.STORAGE_LOCATION));
 	}
+	
+	protected java.nio.file.Path getGitMetadataLocation() {
+		return java.nio.file.Paths.get(ExampleActivator.getDefault().getPreferenceStore()
+				.getString(ExamplesPreferenceConstants.STORAGE_LOCATION), GIT_METADATA_FOLDER);
+	}
 
 	@Override
 	public boolean exists() {
-		return Files.exists(getStorageLocation());
+		return Files.exists(getGitMetadataLocation());
 	}
 
 	@Override