Skip to content

Commit

Permalink
fix: fix install command
Browse files Browse the repository at this point in the history
  • Loading branch information
girardinsamuel committed Sep 27, 2020
1 parent b1d2e7b commit c3c525d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include src/masonite/js_routes/config/js_routes.py
13 changes: 6 additions & 7 deletions src/masonite/js_routes/commands/InstallCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
from masonite.packages import create_or_append_config


package_directory = os.path.dirname(os.path.realpath(__file__))
package_directory = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))


class InstallCommand(Command):
"""
Installs needed configuration files into a Masonite project
Publish js_routes config file.
package:install
js_routes:install
"""

def handle(self):
# publish config files
create_or_append_config(
os.path.join(package_directory, "../config/js_routes.py")
create_or_append_config(os.path.join(package_directory, "config/js_routes.py"))
self.info(
"masonite-js-routes config file has been published to config/js_routes.py."
)
# you could publish views, controllers, commands or assets here
# you can also do it in boot() method of the provider with publishes()
2 changes: 2 additions & 0 deletions src/masonite/js_routes/providers/JSRoutesProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from masonite.provider import ServiceProvider
from masonite.view import View
from masonite.js_routes.commands.GenerateCommand import GenerateCommand
from masonite.js_routes.commands.InstallCommand import InstallCommand

from ..generator import RoutesGenerator

Expand All @@ -18,6 +19,7 @@ class JSRoutesProvider(ServiceProvider):
def register(self):
"""Register objects into the Service Container."""
self.app.bind("GenerateCommand", GenerateCommand())
self.app.bind("InstallCommand", InstallCommand())

def boot(self, view: View):
"""Boots services required by the container."""
Expand Down

0 comments on commit c3c525d

Please sign in to comment.