Skip to content

Commit

Permalink
Merge branch 'release/1.97.26'
Browse files Browse the repository at this point in the history
  • Loading branch information
ktomk committed Dec 7, 2016
2 parents 66cadf1 + ffae98d commit bb289e7
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
RECENT CHANGES
==============

1.97.26
-------
* Upd: bash autocomplete-file
* Imp: Hide password when asked by admin:user:change-password (reported by Faisal Mirza, #873)

1.97.25
-------
* Fix: Add missing new commands to config.yaml (by Giuseppe Morelli, #877)
Expand Down
8 changes: 7 additions & 1 deletion autocompletion/bash/bash_complete
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ _n98-magerun()
cache:view)
opts="${opts} --unserialize --fpc"
;;
category:create:dummy)
opts="${opts} "
;;
cms:block:toggle)
opts="${opts} "
;;
Expand Down Expand Up @@ -284,6 +287,9 @@ _n98-magerun()
dev:translate:shop)
opts="${opts} --on --off"
;;
eav:attribute:create-dummy-values)
opts="${opts} "
;;
eav:attribute:list)
opts="${opts} --filter-type --add-source --add-backend --format"
;;
Expand Down Expand Up @@ -388,7 +394,7 @@ _n98-magerun()

# completing for a command
if [[ $cur == $com ]]; then
coms="help install list open-browser script shell uninstall admin:notifications admin:user:change-password admin:user:change-status admin:user:create admin:user:delete admin:user:list cache:clean cache:dir:flush cache:disable cache:enable cache:flush cache:list cache:report cache:view cms:block:toggle composer:diagnose composer:init composer:install composer:require composer:search composer:update composer:validate config:delete config:dump config:get config:search config:set customer:change-password customer:create customer:create:dummy customer:delete customer:info customer:list db:console db:create db:drop db:dump db:import db:info db:maintain:check-tables db:query db:status db:variables design:demo-notice dev:class:lookup dev:code:model:method dev:console dev:email-template:usage dev:ide:phpstorm:meta dev:log dev:log:db dev:log:size dev:merge-css dev:merge-js dev:module:create dev:module:dependencies:from dev:module:dependencies:on dev:module:disable dev:module:enable dev:module:list dev:module:observer:list dev:module:rewrite:conflicts dev:module:rewrite:list dev:module:update dev:profiler dev:report:count dev:setup:script:attribute dev:symlinks dev:template-hints dev:template-hints-blocks dev:theme:duplicates dev:theme:info dev:theme:list dev:translate:admin dev:translate:export dev:translate:set dev:translate:shop eav:attribute:list eav:attribute:remove eav:attribute:view extension:download extension:install extension:list extension:upgrade extension:validate index:list index:reindex index:reindex:all local-config:generate media:dump script:repo:list script:repo:run seo:check sys:check sys:cron:history sys:cron:list sys:cron:run sys:info sys:maintenance sys:setup:change-version sys:setup:compare-versions sys:setup:incremental sys:setup:remove sys:setup:run sys:store:config:base-url:list sys:store:list sys:url:list sys:website:list"
coms="help install list open-browser script shell uninstall admin:notifications admin:user:change-password admin:user:change-status admin:user:create admin:user:delete admin:user:list cache:clean cache:dir:flush cache:disable cache:enable cache:flush cache:list cache:report cache:view category:create:dummy cms:block:toggle composer:diagnose composer:init composer:install composer:require composer:search composer:update composer:validate config:delete config:dump config:get config:search config:set customer:change-password customer:create customer:create:dummy customer:delete customer:info customer:list db:console db:create db:drop db:dump db:import db:info db:maintain:check-tables db:query db:status db:variables design:demo-notice dev:class:lookup dev:code:model:method dev:console dev:email-template:usage dev:ide:phpstorm:meta dev:log dev:log:db dev:log:size dev:merge-css dev:merge-js dev:module:create dev:module:dependencies:from dev:module:dependencies:on dev:module:disable dev:module:enable dev:module:list dev:module:observer:list dev:module:rewrite:conflicts dev:module:rewrite:list dev:module:update dev:profiler dev:report:count dev:setup:script:attribute dev:symlinks dev:template-hints dev:template-hints-blocks dev:theme:duplicates dev:theme:info dev:theme:list dev:translate:admin dev:translate:export dev:translate:set dev:translate:shop eav:attribute:create-dummy-values eav:attribute:list eav:attribute:remove eav:attribute:view extension:download extension:install extension:list extension:upgrade extension:validate index:list index:reindex index:reindex:all local-config:generate media:dump script:repo:list script:repo:run seo:check sys:check sys:cron:history sys:cron:list sys:cron:run sys:info sys:maintenance sys:setup:change-version sys:setup:compare-versions sys:setup:incremental sys:setup:remove sys:setup:run sys:store:config:base-url:list sys:store:list sys:url:list sys:website:list"

COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
__ltrim_colon_completions "$cur"
Expand Down
56 changes: 56 additions & 0 deletions bin/list-refs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
#
# prepare a list of refs for a git commit message based on file to be committed
# sources information from files staged in the commit and the current GITGUI
# commit / backup message
#
set -euo pipefail
IFS=$'\n\t'

PROJECT_DIR="$(git rev-parse --show-toplevel)"

guess_gitfile() {
GITFILE=GITGUI_MSG
if [[ ! -e "${PROJECT_DIR}/.git//${GITFILE}" ]]; then
GITFILE=GITGUI_BCK
fi
}

list_refs() {
local file="${PROJECT_DIR}"/.git/${GITFILE}
if [ ! -e "${file}" ]; then
return 0;
fi
local shorts="$(grep -o "\b[0-9a-f]\{7,7\}\b" ${file})"
for short in $shorts; do
echo "- $(git log --oneline $short -1)"
done;
}

list_issues() {
local file="${PROJECT_DIR}"/.git/${GITFILE}
if [ ! -e "${file}" ]; then
return 0;
fi
local issues="$(sed -n 's/^.*\(#[0-9]\+\).*$/\1/p' "${file}" | sort -rn | uniq)"
for issue in $issues; do
echo "- $issue"
done;
}

list_commands() {
for file in $(git diff --name-only --cached | grep Command.php$); do
sed -n 's/^.* ->setName(["'\'']\([^"'\'']*\).*)$/- Command: \1/p' "$file"
done;
}

guess_gitfile

echo "Refs:"
(
list_refs
list_issues
list_commands
) | sed 's/^/&\n/'

echo ""
10 changes: 8 additions & 2 deletions n98-magerun.phar
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

echo "Info: Magerun has not been downloaded yet, downloading it ...\n";

$url = 'https://files.magerun.net/n98-magerun.phar';
$target = 'n98-magerun.phar';
$old = md5_file($target);
$file = @fopen($url, 'r');
if ($file === false) {
fputs(STDERR, "Error downloading magerun phar file\n");
Expand All @@ -22,6 +22,13 @@ if (false === $result) {
fputs(STDERR, "Please install manually\n");
exit(1);
}
if ($old === md5_file($target)) {
fputs(STDERR, "Error downloading magerun phar file\n");
fputs(STDERR, "File is of same content\n");
fputs(STDERR, "Please install manually\n");
exit(1);
}

echo "Info: Download done, executing it with original parameters ...\n";

$args = implode(' ', array_map('escapeshellarg', array_slice($argv, 1)));
Expand All @@ -30,4 +37,3 @@ if (0 !== $status) {
fputs(STDERR, "Error executing downloaded phar file\n");
}
exit($status);

2 changes: 1 addition & 1 deletion src/N98/Magento/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Application extends BaseApplication
/**
* @var string
*/
const APP_VERSION = '1.97.25';
const APP_VERSION = '1.97.26';

/**
* @var int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

// Password
if (($password = $input->getArgument('password')) == null) {
$password = $dialog->ask($output, '<question>Password:</question>');
$password = $dialog->askHiddenResponse($output, '<question>Password:</question>');
}

try {
Expand Down
2 changes: 2 additions & 0 deletions src/N98/Magento/Command/Admin/User/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace N98\Magento\Command\Admin\User;

use Symfony\Component\Console\Helper\DialogHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -34,6 +35,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$username = $this->getOrAskForArgument('username', $input, $output);
$email = $this->getOrAskForArgument('email', $input, $output);
if (($password = $input->getArgument('password')) === null) {
/* @var $dialog DialogHelper */
$dialog = $this->getHelper('dialog');
$password = $dialog->askHiddenResponse($output, '<question>Password:</question>');
}
Expand Down
4 changes: 3 additions & 1 deletion src/N98/Magento/Command/Customer/ChangePasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Exception;
use RuntimeException;
use Symfony\Component\Console\Helper\DialogHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -39,12 +40,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
return;
}

/* @var $dialog DialogHelper */
$dialog = $this->getHelper('dialog');
$email = $this->getHelper('parameter')->askEmail($input, $output);

// Password
if (($password = $input->getArgument('password')) == null) {
$password = $dialog->ask($output, '<question>Password:</question>');
$password = $dialog->askHiddenResponse($output, '<question>Password:</question>');
}

$website = $this->getHelper('parameter')->askWebsite($input, $output);
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.97.25
1.97.26

0 comments on commit bb289e7

Please sign in to comment.