Skip to content

Commit 180f0d3

Browse files
committed
Added changelog, changed version
1 parent 95f5ef2 commit 180f0d3

File tree

8 files changed

+31
-9
lines changed

8 files changed

+31
-9
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
0.2.0 :
4+
5+
- Added a check of configuration files modification date to rebuild
6+
- Created an asset directory for testing
7+
- Added possibility to specify the root dir with environment variable PHP_BAND_ASSETS_DIR
8+
9+
0.1.0 : Initial version

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ if you want also to fully compile php while testing, you have to set the environ
4444

4545
# The compilation process
4646

47+
First of all, you can tell php-band to work in another directory than it's install dir by setting the environment variable PHP_BAND_ASSETS_DIR. This directory will be used to :
48+
49+
+ read custom configurations (in *config*)
50+
+ download and extract php archives (in *src*)
51+
+ install php versions (in *inst*)
52+
4753
What does php-band is :
4854

4955
+ check the validity of the version

bin/php-band

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ Where option in
3939
--download php_version : download a php version from source
4040
--install php_version : installs a php version from source
4141
--src-format gz|bz2|xz : format of downloaded archive (default xz)
42+
You can define the working directory for php-band by setting the environment variable PHP_BAND_ASSETS_DIR. See README.md
4243
EOM
4344
exit 1
4445
}
4546

4647
command_version() {
47-
echo "0.1.0"
48+
echo "0.2.0"
4849
exit 0
4950
}
5051

lib/core.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ php_band_check_env() {
3232
[ "" != "$WGET_BIN" -a -x "$WGET_BIN" ] || error_exit "No wget binary" 1
3333
[ "" != "$SED_BIN" -a -x "$SED_BIN" ] || error_exit "No sed binary" 1
3434
[ "" != "$TAR_BIN" -a -x "$TAR_BIN" ] || error_exit "No tar binary" 1
35+
[ -d "${PHP_BAND_ASSETS_DIR}" ] || error_exit "The asset directory '${PHP_BAND_ASSETS_DIR}' does not exist"
36+
[ -d "$PHP_BAND_ARCH_DIR" ] || mkdir "${PHP_BAND_ARCH_DIR}"
37+
[ -d "$PHP_BAND_CONFIG_DIR" ] || mkdir "${PHP_BAND_CONFIG_DIR}"
38+
[ -d "$PHP_BAND_INST_DIR" ] || mkdir "${PHP_BAND_INST_DIR}"
39+
[ -d "$PHP_BAND_SOURCE_DIR" ] || mkdir "${PHP_BAND_SOURCE_DIR}"
3540
}
3641

3742
php_band_parse_version() {

test/10_simple_commands.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load test_helper
44

55
@test "Call php-band with query version argument" {
66
run bin/php-band --version
7-
assert_output "0.1.0"
7+
assert_output "0.2.0"
88
assert_success
99
}
1010

test/90_install.bats

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ load test_helper
1616
if [ "x$PHP_BAND_TEST_COMPILATION" = "x" ]; then
1717
skip "We only compile if PHP_BAND_TEST_COMPILATION is set"
1818
fi
19-
PHP_BAND_ASSETS_DIR=$(dirname ${BATS_TEST_DIRNAME}) run bin/php-band --install 5.6.10
19+
local assets_dir="${BATS_TMPDIR}"
20+
PHP_BAND_ASSETS_DIR=${assets_dir} run bin/php-band --install 5.6.10
2021
assert_line_contains "PHP 5.6.10 has been downloaded"
21-
[ -f "archs/php-5.6.10.tar.xz" ]
22-
[ -d "src/php-5.6.10" ]
23-
[ -f "src/php-5.6.10/.configured" ]
24-
[ -f "src/php-5.6.10/.built" ]
25-
[ -f "inst/5.6.10/bin/php" ]
22+
[ -f "${assets_dir}/archs/php-5.6.10.tar.xz" ]
23+
[ -d "${assets_dir}/src/php-5.6.10" ]
24+
[ -f "${assets_dir}/src/php-5.6.10/.configured" ]
25+
[ -f "${assets_dir}/src/php-5.6.10/.built" ]
26+
[ -f "${assets_dir}/inst/5.6.10/bin/php" ]
2627
assert_status 0
27-
run inst/5.6.10/bin/php -v
28+
run ${assets_dir}/inst/5.6.10/bin/php -v
2829
assert_line_contains "php 5.6.10"
2930
assert_status 0
3031
}

test/assets/inst/.gitkeep

Whitespace-only changes.

test/assets/src/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)