Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Splitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
class Splitter {

const SPLITSH_NAME = 'splitsh-lite';
const SPLITSH_URL = 'https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz';
const BIN_FILES = array(
'splitsh-lite' => 'https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz',
);
const SPLITSH_URL = [
'Linux' => 'https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz',
'Darwin' => 'https://github.com/splitsh/lite/releases/download/v1.0.1/lite_darwin_amd64.tar.gz',
];

/**
* Install splitsh-lite script.
*/
static function install($bin_dir = 'bin') {

$name = self::SPLITSH_NAME;
$url = self::SPLITSH_URL;
$os = php_uname('s');
if (!isset(self::SPLITSH_URL[$os])) {
throw new \LogicException("There's no splitsh-lite version for '{$os}' operating system.");
}
$url = self::SPLITSH_URL[$os];

// @TODO: Load BIN path from composer project bin path.
$bin_path = "{$bin_dir}/{$name}";
Expand Down