Skip to content

Commit 513d062

Browse files
authored
Add asset:create module support (#1370)
1 parent 9f1dd90 commit 513d062

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

modules/system/console/asset/AssetCreate.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
abstract class AssetCreate extends Command
1616
{
17-
protected const TYPE_THEME = 'theme';
17+
protected const TYPE_MODULE = 'module';
1818
protected const TYPE_PLUGIN = 'plugin';
19+
protected const TYPE_THEME = 'theme';
1920

2021
/**
2122
* @var string The console command description.
@@ -114,6 +115,17 @@ protected function getPackagePathType(string $package): array
114115
return [null, null];
115116
}
116117

118+
if (str_starts_with($package, 'module-')) {
119+
if (
120+
($modulePath = base_path('modules') . '/' . str_after($package, 'module-'))
121+
&& File::exists($modulePath)
122+
) {
123+
return [$modulePath, static::TYPE_MODULE];
124+
}
125+
126+
return [null, null];
127+
}
128+
117129
if ($plugin = PluginManager::instance()->findByIdentifier($package)) {
118130
return [$plugin->getPluginPath(), static::TYPE_PLUGIN];
119131
}

0 commit comments

Comments
 (0)