Skip to content

Commit 34de033

Browse files
authored
Add improved splitting utility into CLI (#5)
1 parent 2f1118a commit 34de033

11 files changed

Lines changed: 1165 additions & 12 deletions

File tree

bin/splitsh-lite-mac

3.22 MB
Binary file not shown.

bin/splitsh-lite-unix

3.33 MB
Binary file not shown.

box.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"banner": [
55
"Winter CMS CLI helper.",
66
"",
7-
"(c) 2020 Ben Thomson",
7+
"(c) 2020 Ben Thomson / Winter CMS",
88
"",
99
"This source file is subject to the MIT license that is bundled",
1010
"with this source code in the file LICENSE."
@@ -17,5 +17,32 @@
1717
"version": "##version##",
1818
"datetime": "##datetime##"
1919
},
20-
"algorithm": "SHA256"
20+
"algorithm": "SHA256",
21+
"files": [
22+
"index.php"
23+
],
24+
"directories": [
25+
"src"
26+
],
27+
"directories-bin": [
28+
"bin"
29+
],
30+
"finder": [
31+
{
32+
"notName": "/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/",
33+
"exclude": [
34+
"doc",
35+
"test",
36+
"test_old",
37+
"tests",
38+
"Tests",
39+
"vendor-bin"
40+
],
41+
"in": "vendor"
42+
},
43+
{
44+
"name": "composer.json",
45+
"in": "."
46+
}
47+
]
2148
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"require": {
1313
"php": ">=7.2",
1414
"symfony/console": "^4.4.13",
15+
"symfony/process": "^4.4.13",
1516
"php-http/guzzle6-adapter": "^2.0",
1617
"knplabs/github-api": "^2.15"
1718
},

composer.lock

Lines changed: 62 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BaseCommand.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class BaseCommand extends SymfonyCommand
1717
{
18+
/** @var InputInterface Input interface */
19+
protected $input;
20+
1821
/** @var OutputInterface Output interface */
1922
protected $output;
2023

@@ -23,6 +26,7 @@ class BaseCommand extends SymfonyCommand
2326
*/
2427
public function run(InputInterface $input, OutputInterface $output)
2528
{
29+
$this->input = $input;
2630
$this->output = $output;
2731

2832
// Add success style
@@ -141,4 +145,18 @@ protected function error(string $text, int $verbosity = OutputInterface::VERBOSI
141145
{
142146
$this->output->writeln('<error>' . $text . '</error>', $verbosity);
143147
}
148+
149+
/**
150+
* Gets the base directory for the application.
151+
*
152+
* @param string $path A path to append to the base directory.
153+
* @return string
154+
*/
155+
protected function getBaseDir(string $path = '')
156+
{
157+
return dirname(__DIR__) . ((!empty($path))
158+
? DIRECTORY_SEPARATOR . trim($path, DIRECTORY_SEPARATOR)
159+
: ''
160+
);
161+
}
144162
}

0 commit comments

Comments
 (0)