Skip to content

Commit

Permalink
Merge pull request #38 from Hi-Folks/feat/fix-the-new-2
Browse files Browse the repository at this point in the history
fine tuning and small fix for 2.0
  • Loading branch information
roberto-butti authored Sep 13, 2024
2 parents 1445b49 + 2c94b17 commit 7ac8546
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ vendor/
/content/
/export/
/ibis.php
/stubs/export/
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.0.1 - 13th September 2024
- Check if configuration exists
- Update stubs directory with sample images
- Update the version for `--version`
- update highlight js to 9.18.1 (latest version for 9 major rel)


## 2.0.0 - 13th September 2024
- Upgrading to Pest3 and PHPunit 11(PHP Testing)
- Dropping support for PHP 8.1
Expand Down
36 changes: 18 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ibis-next
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (file_exists(__DIR__ . '/../../autoload.php')) {
/**
* Start the console application.
*/
$app = new Application('Ibis Next', '1.0.12');
$app = new Application('Ibis Next', '2.0 (stable)');
//$app->setDefaultCommand("build");


Expand Down
12 changes: 11 additions & 1 deletion src/Commands/BaseBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ protected function preExecute(InputInterface $input, OutputInterface $output): b
$this->disk = new Filesystem();
$this->output = $output;

$this->config = Config::load($input->getOption('workingdir'));
$workingDir = $input->getOption('workingdir');
try {
$this->config = Config::load($workingDir);
} catch (\Exception) {
$this->output->writeln('<error>Error, check if the ibis.php file exist into the ' . $workingDir . ' directory.</error>');
$this->output->writeln('<info>Did you run `ibis-next init`?</info>');
return false;

}


$this->output->writeln('<info>Loading config/assets from: ' . $this->config->workingPath . '</info>');
$this->output->writeln('<info>Loading config file from: ' . $this->config->ibisConfigPath . '</info>');
if ($this->config->setContentPath($input->getOption('content')) === false) {
Expand Down
7 changes: 6 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public function __construct(public $workingPath = "")
}

$this->ibisConfigPath = self::buildPath($this->workingPath, 'ibis.php');
$this->config = require $this->ibisConfigPath;
if (file_exists($this->ibisConfigPath)) {
$this->config = require $this->ibisConfigPath;
} else {
throw new \Exception("The file " . $this->ibisConfigPath . " doesn't exists.");
}

}

public static function load($directory = ""): self
Expand Down
Binary file added stubs/assets/images/aside-examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added stubs/assets/images/ibis-next-cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion stubs/assets/theme-dark.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/sunburst.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/sunburst.min.css">
<style>
body {
font-family: calibri;
Expand Down
4 changes: 2 additions & 2 deletions stubs/assets/theme-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Milligram CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css">
<!-- Highlight CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/github-gist.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/github-gist.min.css">
</head>
<body>
<main class='container'>
Expand All @@ -22,4 +22,4 @@
{{$body}}
</main>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion stubs/assets/theme-light.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/github-gist.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/github-gist.min.css">
<style>
body {
font-family: calibri;
Expand Down

0 comments on commit 7ac8546

Please sign in to comment.