Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

.github export-ignore
.phive export-ignore
tests export-ignore
.* export-ignore
box.json.dist export-ignore
*.dist export-ignore
*.yaml export-ignore
*.xml export-ignore
composer.lock export-ignore
composer-require-* export-ignore
docker-compose.yaml export-ignore
Makefile export-ignore
phpunit.xml* export-ignore
psalm.* export-ignore
psalm-baseline.xml export-ignore
infection.* export-ignore
codecov.* export-ignore
tests export-ignore
docs export-ignore
resources/mock export-ignore

*.http binary
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ composer require internal/dload -W

## Command Line Usage

DLoad offers two main commands:
DLoad offers three main commands:

### List Available Software

Expand All @@ -54,6 +54,21 @@ This displays a list of all registered software packages with their IDs, names,
DLoad comes with a pre-configured list of popular tools and software packages ready for download.
You can contribute to this list by submitting issues or pull requests to the DLoad repository.

### Show Downloaded Software

```bash
# View all downloaded software
./vendor/bin/dload show

# Show detailed information about specific software
./vendor/bin/dload show rr

# Show all available software, including those not downloaded
./vendor/bin/dload show --all
```

This command displays information about downloaded software.

### Download Software

```bash
Expand Down
1 change: 1 addition & 0 deletions bin/dload
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
new FactoryCommandLoader([
Command\Get::getDefaultName() => static fn() => new Command\Get(),
Command\ListSoftware::getDefaultName() => static fn() => new Command\ListSoftware(),
Command\Show::getDefaultName() => static fn() => new Command\Show(),
]),
);
$application->setDefaultCommand(Command\Get::getDefaultName(), false);
Expand Down
38 changes: 30 additions & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,26 @@
<MoreSpecificReturnType>
<code><![CDATA[list<DownloadConfig>]]></code>
</MoreSpecificReturnType>
<PropertyNotSetInConstructor>
<code><![CDATA[Get]]></code>
<code><![CDATA[Get]]></code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Command/ListSoftware.php">
<PropertyNotSetInConstructor>
<code><![CDATA[ListSoftware]]></code>
<code><![CDATA[ListSoftware]]></code>
</PropertyNotSetInConstructor>
<RiskyTruthyFalsyComparison>
<code><![CDATA[$software->homepage]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/Command/Show.php">
<InvalidArrayOffset>
<code><![CDATA[$units[$i]]]></code>
</InvalidArrayOffset>
<InvalidOperand>
<code><![CDATA[$bytes /= 1024]]></code>
</InvalidOperand>
<MixedArgument>
<code><![CDATA[$units[$i]]]></code>
</MixedArgument>
<PossiblyFalseArgument>
<code><![CDATA[$destinationPath]]></code>
</PossiblyFalseArgument>
</file>
<file src="src/DLoad.php">
<ArgumentTypeCoercion>
<code><![CDATA[$files]]></code>
Expand Down Expand Up @@ -101,6 +107,22 @@
<code><![CDATA[ZipPharArchive]]></code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Module/Binary/Internal/BinaryExecutor.php">
<MixedArgumentTypeCoercion>
<code><![CDATA[$output]]></code>
<code><![CDATA[$output]]></code>
</MixedArgumentTypeCoercion>
</file>
<file src="src/Module/Binary/Internal/VersionComparator.php">
<PossiblyNullArgument>
<code><![CDATA[$versionOnly]]></code>
<code><![CDATA[\preg_replace('/[-+].*$/', '', $constraint)]]></code>
</PossiblyNullArgument>
<RedundantCondition>
<code><![CDATA[!$hasPreB]]></code>
<code><![CDATA[$bIsNum]]></code>
</RedundantCondition>
</file>
<file src="src/Module/Common/Config/Action/Download.php">
<MissingConstructor>
<code><![CDATA[$software]]></code>
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<RedundantConditionGivenDocblockType errorLevel="suppress"/>
<RedundantCastGivenDocblockType errorLevel="suppress"/>
<MissingOverrideAttribute errorLevel="suppress"/>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="src/Command"/>
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers>
<projectFiles>
<directory name="src"/>
Expand Down
37 changes: 30 additions & 7 deletions resources/software.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"alias": "rr",
"binary": {
"name": "rr",
"pattern": "/^(roadrunner|rr)(?:\\.exe)?$/"
"pattern": "/^(roadrunner|rr)(?:\\.exe)?$/",
"version-command": "--version"
},
"homepage": "https://roadrunner.dev",
"description": "High-performance PHP application server, load-balancer and process manager written in Golang",
Expand All @@ -29,7 +30,8 @@
}
],
"binary": {
"name": "temporal"
"name": "temporal",
"version-command": "--version"
}
},
{
Expand All @@ -45,7 +47,8 @@
}
],
"binary": {
"name": "dolt"
"name": "dolt",
"version-command": "--version"
}
},
{
Expand Down Expand Up @@ -75,7 +78,8 @@
}
],
"binary": {
"name": "protoc"
"name": "protoc",
"version-command": "--version"
}
},
{
Expand All @@ -91,11 +95,12 @@
}
],
"binary": {
"name": "tigerbeetle"
"name": "tigerbeetle",
"version-command": "version"
}
},
{
"name": "CTX ",
"name": "CTX",
"alias": "ctx",
"description": "Context generator and MCP server",
"homepage": "https://docs.ctxgithub.com/",
Expand All @@ -108,7 +113,25 @@
],
"binary": {
"name": "ctx",
"pattern": "/^ctx-.*$/"
"pattern": "/^ctx-.*$/",
"version-command": "--version"
}
},
{
"name": "Trap",
"alias": "trap",
"description": "A minimized version of the Buggregator Server that does not require Docker and is intended solely for local use.\n",
"homepage": "https://buggregator.dev/",
"repositories": [
{
"type": "github",
"uri": "buggregator/trap",
"asset-pattern": "/^trap-.*/"
}
],
"binary": {
"name": "trap",
"version-command": "--version"
}
}
]
6 changes: 6 additions & 0 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Internal\DLoad;

use Internal\DLoad\Module\Binary\BinaryProvider;
use Internal\DLoad\Module\Binary\Internal\BinaryProviderImpl;
use Internal\DLoad\Module\Common\Architecture;
use Internal\DLoad\Module\Common\Internal\Injection\ConfigLoader;
use Internal\DLoad\Module\Common\Internal\ObjectContainer;
Expand Down Expand Up @@ -100,6 +102,10 @@
static fn(Container $container): RepositoryProvider => (new RepositoryProvider())
->addRepositoryFactory($container->get(GithubRepositoryFactory::class)),
);
$this->container->bind(
BinaryProvider::class,
static fn(Container $c): BinaryProvider => $c->get(BinaryProviderImpl::class),
);

Check warning on line 108 in src/Bootstrap.php

View check run for this annotation

Codecov / codecov/patch

src/Bootstrap.php#L105-L108

Added lines #L105 - L108 were not covered by tests

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*
* @return non-empty-string|null Path to the configuration file
*/
private function getConfigFile(InputInterface $input): ?string
protected function getConfigFile(InputInterface $input): ?string

Check warning on line 94 in src/Command/Base.php

View check run for this annotation

Codecov / codecov/patch

src/Command/Base.php#L94

Added line #L94 was not covered by tests
{
/** @var string|null $config */
$config = $input->getOption('config');
Expand Down
Loading
Loading