Skip to content

Commit

Permalink
chore: fixes 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeerickson committed Apr 24, 2019
1 parent 4ce3c06 commit 3650f57
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [1.3.0] - 2019.04.23
## [1.3.0] - 2019.04.24

### Added

Expand Down Expand Up @@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added new `template` option which allows passing a one off template to be used instead of using either default templates, or user defined templates in constants.
- Added new `template` option which allows passing a one off template to be used instead of using either default templates, or user defined templates in constants.

## [1.0.10] - 2019-04-06

Expand All @@ -62,7 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Refactor tests, cleanup
- Refactor tests, cleanup

## [1.0.8] - 2019-04-04

Expand Down
9 changes: 6 additions & 3 deletions app/CraftsmanFileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,15 @@ private function createMergeFile($src, $dest, $data)
try {
$this->createParentDirectory($dest);
$this->fs->put($dest, $merged_data);
$shortenFilename = $this->shortenFilename($dest);
$dest = $this->tildify(($dest));

$result = [
"filename" => $dest,
"status" => "success",
"message" => "{$dest} created successfully",
];
Messenger::success("{$result['message']}\n");
Messenger::success("{$shortenFilename} created successfully\n");
} catch (Exception $e) {
$result = [
"status" => "error",
Expand Down Expand Up @@ -518,6 +520,7 @@ public function createFile($type = null, $filename = null, $data = [])

$mustache = new Mustache_Engine();

// when creation migrations, the class method should be plural
if ($type === "migration") {
$vars["model"] = Str::plural($vars["model"]);
}
Expand All @@ -534,6 +537,7 @@ public function createFile($type = null, $filename = null, $data = [])
try {
$this->createParentDirectory($dest);
$this->fs->put($dest, $template_data);
$shortenFilename = $this->shortenFilename($dest);
$dest = $this->tildify($dest);
$result = [
"filename" => $dest,
Expand All @@ -550,8 +554,7 @@ public function createFile($type = null, $filename = null, $data = [])
}

if ($result["status"] === "success") {
$dest = $this->shortenFilename($dest);
Messenger::success("✔︎ {$dest} created successfully\n");
Messenger::success("✔︎ {$shortenFilename} created successfully\n");
}

return $result;
Expand Down
Binary file modified builds/laravel-craftsman
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/templates/api-controller.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use {{model_path}};
{{model_path}};

class {{name}} extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion builds/templates/controller.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use {{model_path}};
{{model_path}};

class {{name}} extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion builds/templates/factory.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use {{model_path}};
{{model_path}};
use Faker\Generator as Faker;

$factory->define({{model}}::class, function (Faker $faker) {
Expand Down
2 changes: 1 addition & 1 deletion builds/templates/seed.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use {{model_path}};
{{model_path}};
use Illuminate\Database\Seeder;

class {{model}}sTableSeeder extends Seeder
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "laravel-craftsman",
"version": "1.3.0",
"build": "140",
"build": "141",
"description": "Laravel Craftsman",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 3650f57

Please sign in to comment.