Skip to content

Commit

Permalink
Merge pull request #1 from DrAnax/master
Browse files Browse the repository at this point in the history
Added support for Jeffrey Way's Laravel Generator
  • Loading branch information
Narven committed Apr 2, 2013
2 parents 1967d11 + 1f47402 commit 17f8cce
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@
"id" : "SublimeArtisanRouteCall",
"caption" : "Sublime Artisan Route:Call",
"command" : "sublime_artisan_route_call"
},{
"id" : "SublimeArtisanGenerate",
"caption" : "Sublime Artisan Generate:",
"command" : "sublime_artisan_generate"
}]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Options Available:
- Running the application tests (php artisan test)
- Running the bundle tests (php artisan test bundle-name)
- Calling a route (php artisan route:call get api/user/1)
- Support for Jeffrey Way's [Laravel Generator](https://github.com/JeffreyWay/Laravel-Generator)

INSTALLATION
Just create a the directory SublimeArtisan in your Sublime Text Packages directory, and you're ready to go.
Expand Down
21 changes: 21 additions & 0 deletions SublimeArtisan.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,24 @@ def on_done(self, route):

except ValueError:
pass

class SublimeArtisanGenerateCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.show_input_panel("[controller|model|view|migration|test|asset|resource|help] [args] ", "", self.on_done, None, None)

def on_done(self, generate_command):
try:
folder = self.window.folders()[0]
os.chdir(folder)

args = generate_command.split(" ")
cmd = 'generate:' + args[0]
print (["php", "artisan", cmd, args[1:]])

self.window.run_command("exec", {
"cmd" : ["php", "artisan", cmd] + args[1:],
"shell" : False,
"working_dir" : folder})

except ValueError:
pass

0 comments on commit 17f8cce

Please sign in to comment.