Skip to content

Commit

Permalink
Bugfix in the installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed May 9, 2018
1 parent b5d4139 commit d8b1916
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bref
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Yaml\Yaml;

const PHP_VERSION = '7.2.5';
const PHP_TARGET_VERSION = '7.2.5';

if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
Expand Down Expand Up @@ -77,18 +77,18 @@ $app->command('deploy', function (SymfonyStyle $io) {
}

// Cache PHP's binary in `.bref/bin/php`
if (!$fs->exists('.bref/bin/php/php-' . PHP_VERSION . '.tar.gz')) {
if (!$fs->exists('.bref/bin/php/php-' . PHP_TARGET_VERSION . '.tar.gz')) {
$io->writeln('Downloading PHP in the `.bref/bin/` directory');
$fs->mkdir('.bref/bin/php');
$defaultUrl = 'https://s3.amazonaws.com/bref-php/bin/php-' . PHP_VERSION . '.tar.gz';
$defaultUrl = 'https://s3.amazonaws.com/bref-php/bin/php-' . PHP_TARGET_VERSION . '.tar.gz';
// TODO document this option
$url = $projectConfig['php'] ?? $defaultUrl;
$commandRunner->run("curl -sSL $url -o .bref/bin/php/php-' . PHP_VERSION . '.tar.gz");
$commandRunner->run("curl -sSL $url -o .bref/bin/php/php-" . PHP_TARGET_VERSION . ".tar.gz");
}

$io->writeln('Installing the PHP binary');
$fs->mkdir('.bref/output/.bref/bin');
$commandRunner->run('tar -xzf .bref/bin/php/php-' . PHP_VERSION . '.tar.gz -C .bref/output/.bref/bin');
$commandRunner->run('tar -xzf .bref/bin/php/php-' . PHP_TARGET_VERSION . '.tar.gz -C .bref/output/.bref/bin');

$io->writeln('Installing `handler.js`');
$fs->copy(__DIR__ . '/template/handler.js', '.bref/output/handler.js');
Expand Down

0 comments on commit d8b1916

Please sign in to comment.