Skip to content

Commit

Permalink
Bugfixes in generator
Browse files Browse the repository at this point in the history
  • Loading branch information
noccy80 committed Dec 15, 2016
1 parent 9adb4d9 commit 0e59446
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/phpl-generate
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ function print_help() {
printf("\n");
}

$opts = cmdl_parse("hr:",[
$opts = cmdl_parse("hd:s:",[
"h" => "help",
"r" => "read:",
"d" => "dir:",
"s" => "status:",
]);

if (cmdl_get($opts,'help')) {
Expand Down
2 changes: 1 addition & 1 deletion modules/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function _status(array $opts=[]) {
$character = (posix_getuid()==0)?$opts[STATUS_CHARACTER_ROOT]:$opts[STATUS_CHARACTER];
$style = (LAST_STATUS)?$opts[STATUS_STYLE_BAD]:$opts[STATUS_STYLE_GOOD];

return panel( $character, [ 'class' => (LAST_STATUS?'bad':'good') ], 'status' );
return panel( $character, [ 'class' => ((LAST_STATUS>0)?'bad':'good') ], 'status' );
}

module("status", "Command status and root indicator");
3 changes: 2 additions & 1 deletion powerline.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@


function _updateprompt {
export LAST=$?
export BASH_CWD="$(pwd)"
export PS1="$(phpl-generate -s $? -d $BASH_CWD) "
export PS1="$(phpl-generate -s $LAST -d $BASH_CWD) "
}

export PROMPT_COMMAND="_updateprompt"

0 comments on commit 0e59446

Please sign in to comment.