Skip to content

Commit 730ecc1

Browse files
avargitster
authored andcommitted
remote-mediawiki tests: change [] to test
Convert `[]` to `test` and break if-then into separate lines, both of which bring the style in line with Git's coding guidelines. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 090850e commit 730ecc1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

contrib/mw-to-git/t/test-gitmw-lib.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test_check_precond () {
6565
GIT_EXEC_PATH=$(cd "$(dirname "$0")" && cd "../.." && pwd)
6666
PATH="$GIT_EXEC_PATH"'/bin-wrapper:'"$PATH"
6767

68-
if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ];
68+
if ! test -d "$WIKI_DIR_INST/$WIKI_DIR_NAME"
6969
then
7070
skip_all='skipping gateway git-mw tests, no mediawiki found'
7171
test_done
@@ -304,7 +304,8 @@ create_db () {
304304
php "$FILES_FOLDER/$DB_INSTALL_SCRIPT" $(basename "$DB_FILE" .sqlite) \
305305
"$WIKI_ADMIN" "$WIKI_PASSW" "$TMP" "$PORT"
306306

307-
if [ ! -f "$TMP/$DB_FILE" ] ; then
307+
if ! test -f "$TMP/$DB_FILE"
308+
then
308309
error "Can't create database file $TMP/$DB_FILE. Try to run ./install-wiki.sh delete first."
309310
fi
310311

@@ -325,15 +326,17 @@ wiki_install () {
325326
# unpack and copy the files of MediaWiki
326327
(
327328
mkdir -p "$WIKI_DIR_INST/$WIKI_DIR_NAME"
328-
if [ ! -d "$WIKI_DIR_INST/$WIKI_DIR_NAME" ] ; then
329+
if ! test -d "$WIKI_DIR_INST/$WIKI_DIR_NAME"
330+
then
329331
error "Folder $WIKI_DIR_INST/$WIKI_DIR_NAME doesn't exist.
330332
Please create it and launch the script again."
331333
fi
332334

333335
# Fetch MediaWiki's archive if not already present in the TMP directory
334336
MW_FILENAME="mediawiki-$MW_VERSION_MAJOR.$MW_VERSION_MINOR.tar.gz"
335337
cd "$TMP"
336-
if [ ! -f $MW_FILENAME ] ; then
338+
if ! test -f $MW_FILENAME
339+
then
337340
echo "Downloading $MW_VERSION_MAJOR.$MW_VERSION_MINOR sources ..."
338341
wget "http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/$MW_FILENAME" ||
339342
error "Unable to download "\
@@ -359,7 +362,8 @@ wiki_install () {
359362
# And modify parameters according to the ones set at the top
360363
# of this script.
361364
# Note that LocalSettings.php is never modified.
362-
if [ ! -f "$FILES_FOLDER/LocalSettings.php" ] ; then
365+
if ! test -f "$FILES_FOLDER/LocalSettings.php"
366+
then
363367
error "Can't find $FILES_FOLDER/LocalSettings.php " \
364368
"in the current folder. "\
365369
"Please run the script inside its folder."
@@ -401,7 +405,8 @@ wiki_install () {
401405
# Warning: This function must be called only in a subdirectory of t/ directory
402406
wiki_reset () {
403407
# Copy initial database of the wiki
404-
if [ ! -f "../$FILES_FOLDER/$DB_FILE" ] ; then
408+
if ! test -f "../$FILES_FOLDER/$DB_FILE"
409+
then
405410
error "Can't find ../$FILES_FOLDER/$DB_FILE in the current folder."
406411
fi
407412
cp "../$FILES_FOLDER/$DB_FILE" "$TMP" ||

0 commit comments

Comments
 (0)