Skip to content

Commit

Permalink
Update composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 authored and Recca Tsai committed Feb 4, 2016
1 parent a3a36cd commit 04e6930
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 9 additions & 19 deletions resources/assets/coffee/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@ do ($ = jQuery, window, document) ->
colors: $.terminal.ansi_colors
term: null,
defaultPrompt: "$ "
needConfirm:
"artisan": [
"migrate"
"migrate:install"
"migrate:refresh"
"migrate:reset"
"migrate:rollback"
"db:seed"
]
color: (color, background, type = "bold") =>
if @colors[type] and @colors[type][color]
return @colors[type][color]
Expand Down Expand Up @@ -184,7 +175,7 @@ do ($ = jQuery, window, document) ->
@execute term, "#{commandPrefix.replace(/\s+/g, '-')} #{command}"
return false
,
prompt: "#{prompt} >"
prompt: "#{prompt}> "
return false

capitalize = (str) =>
Expand All @@ -205,9 +196,9 @@ do ($ = jQuery, window, document) ->
term.echo " "

commandArtisan: (term, cmd) =>
cmd2 = $.terminal.parseCommand cmd.rest.trim()
if @options.environment is "production" and $.inArray("--force", cmd2.args) is -1
if $.inArray(cmd2.name, @options.confirmToProceed[cmd.name]) isnt -1
restParsed = $.terminal.parseCommand cmd.rest.trim()
if @options.environment is "production" and $.inArray("--force", restParsed.args) is -1
if $.inArray(restParsed.name, @options.confirmToProceed[cmd.name]) isnt -1
@confirmToProceed term, cmd
return
@rpcRequest term, cmd
Expand All @@ -231,11 +222,6 @@ do ($ = jQuery, window, document) ->
Loading.hide term
@serverInfo(term)

interpreters:
"mysql": "mysql"
"artisan tinker": "tinker"
"tinker": "tinker"

execute: (term, command) =>
command = command.trim()
switch command
Expand All @@ -245,7 +231,7 @@ do ($ = jQuery, window, document) ->
when ""
return
else
for interpreter, prompt of @interpreters
for interpreter, prompt of @options.interpreters
if command is interpreter
@interpreter prompt, term
return
Expand All @@ -272,6 +258,8 @@ do ($ = jQuery, window, document) ->
].join "\n"

serverInfo: (term) =>
if term.level() > 1
return
host = @info "#{@options.username}@#{@options.hostname}"
os = @question "#{@options.os}"
path = @comment "#{@options.basePath}"
Expand All @@ -285,5 +273,7 @@ do ($ = jQuery, window, document) ->
@execute term, 'list'
onBlur: =>
false
onClear: (term) =>
@serverInfo(term)
greetings: @greetings()
prompt: @defaultPrompt
2 changes: 1 addition & 1 deletion ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<rule ref="rulesets/naming.xml/ShortVariable">
<priority>1</priority>
<properties>
<property name="minimum" value="2" />
<property name="minimum" value="1" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
Expand Down
14 changes: 14 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,18 @@ private function isFromArtisanStartingEvent()

return false;
}

/**
* Renders a caught exception.
*
* @param \Exception $e An exception instance
* @param OutputInterface $output An OutputInterface instance
*/
public function renderException(Exception $e, OutputInterface $output)
{
while ($prevException = $e->getPrevious()) {
$e = $prevException;
}
parent::renderException($e, $output);
}
}
2 changes: 1 addition & 1 deletion src/Console/Commands/Artisan.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Artisan extends Command
*
* @var string
*/
protected $description = 'artisan';
protected $description = 'laravel artisan';

/**
* no support array.
Expand Down
5 changes: 5 additions & 0 deletions src/Http/Controllers/TerminalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function index(ApplicationContract $app, ConsoleKernel $consoleKernel)
'version' => $app->version(),
'endPoint' => action('\\'.static::class.'@rpcResponse'),
'helpInfo' => $consoleKernel->output(),
'interpreters' => [
'mysql' => 'mysql',
'artisan tinker' => 'tinker',
'tinker' => 'tinker',
],
'confirmToProceed' => [
'artisan' => [
'migrate',
Expand Down

0 comments on commit 04e6930

Please sign in to comment.