Revisions
-
torkiljohnsen revised this gist
Mar 20, 2012 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ foreach ($deps as $name => $dep) { $dep = array_map('trim', $dep); if(!(isset($dep['git']) || isset($dep['svn'])) || !isset($dep['version']) || !isset($dep['target'])) { exit("deps: Missing variables in [$name]".PHP_EOL); } @@ -69,4 +69,3 @@ system($update); } -
Torkil Johnsen revised this gist
Jan 22, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -64,7 +64,7 @@ if (isset($dep['git'])) { $update = sprintf('cd %s && git fetch origin && git fetch --tags origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($dep['version'])); } elseif (isset($dep['svn'])) { $update = sprintf('cd %s && svn update -r %d', escapeshellarg($installDir), escapeshellarg($dep['version'])); } system($update); -
Torkil Johnsen revised this gist
Jan 22, 2012 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,17 +33,17 @@ $deps = parse_ini_file($rootDir.'/deps.ini', true, INI_SCANNER_RAW); if (false === $deps) { exit("The deps.ini file is not valid ini syntax. Perhaps missing a trailing newline?\n"); } foreach ($deps as $name => $dep) { $dep = array_map('trim', $dep); if(!(isset($dep['git']) && !isset($dep['svn'])) || !isset($dep['version']) || !isset($dep['target'])) { exit("deps: Missing variables in [$name]".PHP_EOL); } $installDir = $rootDir.'/'.$dep['target']; $install = false; if (!is_dir($installDir)) { $install = true; -
Torkil Johnsen revised this gist
Jan 22, 2012 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,9 @@ * target=path/to/vendor/name * version=COMMITISH * [some_other_name] * svn=REPO * target=path/to/other/vendor/name * version=number * ... */ @@ -36,7 +39,7 @@ foreach ($deps as $name => $dep) { $dep = array_map('trim', $dep); if(!(isset($dep['git']) && !isset($dep['svn'])) || !isset($dep['version']) || !isset($dep['target'])) { exit("deps: Missing variables in [$name]".PHP_EOL); } @@ -46,13 +49,24 @@ $install = true; echo "> Installing $name\n"; if (isset($dep['git'])) { $install = sprintf('git clone %s %s', escapeshellarg($dep['git']), escapeshellarg($installDir)); } elseif (isset($dep['svn'])) { $install = sprintf('svn checkout %s %s', escapeshellarg($dep['svn']), escapeshellarg($installDir)); } system($install); } if (!$install) { echo "> Updating $name\n"; } if (isset($dep['git'])) { $update = sprintf('cd %s && git fetch origin && git fetch --tags origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($dep['version'])); } elseif (isset($dep['svn'])) { $update = sprintf('svn update -r %d %s', escapeshellarg($dep['version']), escapeshellarg($installDir)); } system($update); } -
mathiasverraes revised this gist
Jan 21, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ * [some_name] * git=REPO * target=path/to/vendor/name * version=COMMITISH * [some_other_name] * ... */ @@ -53,6 +53,6 @@ echo "> Updating $name\n"; } system(sprintf('cd %s && git fetch origin && git fetch --tags origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($dep['version']))); } -
mathiasverraes revised this gist
Jan 21, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ * [some_name] * git=REPO * target=path/to/vendor/name * version=origin/COMMITISH * [some_other_name] * ... */ -
mathiasverraes created this gist
Jan 21, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ #!/usr/bin/env php <?php /* * Custom version of Symfony2's vendor script * Put this file in /bin and make a deps.ini file in the root, looking like this: * * [some_name] * git=REPO * target=path/to/vendor/name * version=COMMITISH * [some_other_name] * ... */ /* * This file is part of the Symfony framework. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ set_time_limit(0); $rootDir = dirname(__DIR__); if (!is_dir("$rootDir/vendor")) { mkdir("$rootDir/vendor", 0777, true); } $deps = parse_ini_file($rootDir.'/deps.ini', true, INI_SCANNER_RAW); if (false === $deps) { exit("The deps.ini file is not valid ini syntax. Perhaps missing a trailing newline?\n"); } foreach ($deps as $name => $dep) { $dep = array_map('trim', $dep); if(!isset($dep['git']) || !isset($dep['version']) || !isset($dep['target'])) { exit("deps: Missing variables in [$name]".PHP_EOL); } $installDir = $rootDir.'/'.$dep['target']; $install = false; if (!is_dir($installDir)) { $install = true; echo "> Installing $name\n"; system(sprintf('git clone %s %s', escapeshellarg($dep['git']), escapeshellarg($installDir))); } if (!$install) { echo "> Updating $name\n"; } system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($dep['version']))); }