Skip to content

Commit

Permalink
Merge f1faad1 into 04e7a36
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Jul 29, 2018
2 parents 04e7a36 + f1faad1 commit a43f9bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions masonite/commands/SeedCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ class SeedCommand(Command):
"""

def handle(self):
if not 'sys.path.append(os.getcwd())' in open('databases/seeds/__init__.py').read():
f = open('databases/seeds/__init__.py', 'w+')
f.write('import os\nimport sys\nsys.path.append(os.getcwd())\n')
f.close()

table = self.argument('table').lower()
subprocess.call([
"orator make:seed {}_table_seeder -p databases/seeds".format(table),
], shell=True)


5 changes: 5 additions & 0 deletions masonite/commands/SeedRunCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class SeedRunCommand(Command):
"""

def handle(self):
if not 'sys.path.append(os.getcwd())' in open('databases/seeds/__init__.py').read():
f = open('databases/seeds/__init__.py', 'w+')
f.write('import os\nimport sys\nsys.path.append(os.getcwd())\n')
f.close()

table = self.argument('table').lower()
if not table == 'none':
seeder = '--seeder {}_table_seeder'.format(table.lower())
Expand Down

0 comments on commit a43f9bb

Please sign in to comment.