Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github init command #30

Merged
merged 4 commits into from
Mar 18, 2024
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
2 changes: 1 addition & 1 deletion dist/.github/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore common files
/.* export-ignore
# /.* export-ignore

# Exclude specific directory
/tests/ export-ignore
Expand Down
15 changes: 7 additions & 8 deletions src/Service/GithubInitService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function run(): int
$this->addEditorConfig();
$this->addGitAttributes();
$this->addGitIgnore();
$this->addReadme();

$this->io->success('All work was correctly done!');

Expand Down Expand Up @@ -85,8 +84,8 @@ protected function addEditorConfig(): void
questionMessage: 'It seems that a .editorconfig already exists, do you want to override?',
overrideCommentMessage: 'Adding .editorconfig',
skippedMessage: 'Skipped creation of .editorconfig',
sourceFileDirectory: $this->githubDirectoryPath,
distFileDirectory: DirectoryPath::DIST_GITHUB->value
sourceFileDirectory: '',
distFileDirectory: Path::normalize(DirectoryPath::DIST_GITHUB->value)
);
}

Expand All @@ -98,8 +97,8 @@ protected function addGitAttributes(): void
questionMessage: 'It seems that a .gitattributes already exists, do you want to override?',
overrideCommentMessage: 'Adding .gitattributes',
skippedMessage: 'Skipped creation of .gitattributes',
sourceFileDirectory: $this->githubDirectoryPath,
distFileDirectory: DirectoryPath::DIST_GITHUB->value
sourceFileDirectory: '',
distFileDirectory: Path::normalize(DirectoryPath::DIST_GITHUB->value)
);
}

Expand All @@ -111,8 +110,8 @@ protected function addGitIgnore(): void
questionMessage: 'It seems that a .gitignore already exists, do you want to override?',
overrideCommentMessage: 'Adding .gitignore',
skippedMessage: 'Skipped creation of .gitignore',
sourceFileDirectory: $this->githubDirectoryPath,
distFileDirectory: DirectoryPath::DIST_GITHUB->value
sourceFileDirectory: '',
distFileDirectory: Path::normalize(DirectoryPath::DIST_GITHUB->value)
);
}

Expand All @@ -124,7 +123,7 @@ protected function addReadme(): void
questionMessage: 'It seems that a README.md already exists, do you want to override?',
overrideCommentMessage: 'Adding README.md',
skippedMessage: 'Skipped creation of README.md',
sourceFileDirectory: $this->githubDirectoryPath,
sourceFileDirectory: '',
distFileDirectory: DirectoryPath::DIST_GITHUB->value
);
}
Expand Down
2 changes: 2 additions & 0 deletions whitecat
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ require WHITECAT_COMPOSER_INSTALL;

use Symfony\Component\Console\Application;
use Whitecat\Command\DockerSetupCommand;
use Whitecat\Command\GithubInitCommand;
use Whitecat\Command\GithubIssueCommand;
use Whitecat\Command\GithubPullCommand;
use Whitecat\Command\GithubWorkflowCommand;
Expand All @@ -71,6 +72,7 @@ $application = new Application();

try {
$application->add(new DockerSetupCommand());
$application->add(new GithubInitCommand());
$application->add(new GithubIssueCommand());
$application->add(new GithubPullCommand());
$application->add(new GithubWorkflowCommand());
Expand Down
Loading