mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Bugfix: dvc init
This commit is contained in:
@@ -86,6 +86,9 @@ class Project(object):
|
||||
scm.ignore_list([cache.cache_dir,
|
||||
state.state_file,
|
||||
lock.lock_file])
|
||||
|
||||
ignore_file = os.path.join(dvc_dir, scm.ignore_file())
|
||||
scm.add([config.config_file, ignore_file])
|
||||
scm.commit('DVC init')
|
||||
|
||||
return Project(root_dir)
|
||||
|
||||
+9
-6
@@ -17,15 +17,15 @@ class Base(object):
|
||||
def ignore(self, path):
|
||||
pass
|
||||
|
||||
def ignore_file(self):
|
||||
pass
|
||||
|
||||
def ignore_list(self, p_list):
|
||||
return [self.ignore(path) for path in p_list]
|
||||
|
||||
def add(self, path):
|
||||
def add(self, paths):
|
||||
pass
|
||||
|
||||
def add_list(self, p_list):
|
||||
return [self.add(path) for path in p_list]
|
||||
|
||||
def commit(self, msg):
|
||||
pass
|
||||
|
||||
@@ -67,8 +67,11 @@ class Git(Base):
|
||||
|
||||
open(gitignore, 'a').write('\n' + entry)
|
||||
|
||||
def add(self, path):
|
||||
self.repo.index.add(path)
|
||||
def ignore_file(self):
|
||||
return self.GITIGNORE
|
||||
|
||||
def add(self, paths):
|
||||
self.repo.index.add(paths)
|
||||
|
||||
def commit(self, msg):
|
||||
self.repo.index.commit(msg)
|
||||
|
||||
Reference in New Issue
Block a user