Skip to content

Commit

Permalink
Merge pull request #30 from Trusted97/feat/add-github-init-command
Browse files Browse the repository at this point in the history
feat: add github init command
  • Loading branch information
Trusted97 authored Mar 18, 2024
2 parents 735aead + d5bfd05 commit 00fd003
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
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

0 comments on commit 00fd003

Please sign in to comment.