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

Pulling fix/gruntfile-path into main #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

veve40
Copy link
Contributor

@veve40 veve40 commented Nov 28, 2022

Merging fix/gruntfile-path into main

Changes :

Copy link
Collaborator

@mcaskill mcaskill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we make this path configurable to support framework (charcoal/charcoal) and package (charcoal/admin) installation as well as standalone installation (if package is cloned directly without being a dependency of a project)?

.gitignore:

  # Codebase
  
  /build/docs/
  /build/logs/
  /build/report/
+ /www/

Gruntfile.js:

      var path = require('path');
+     var cwd  = process.cwd();
+ 
+     var basePath = '';
+     if (cwd.includes('/vendor/charcoal/')) {
+         if (cwd.includes('/packages/admin/')) {
+             // Framework installation
+             basePath = '../../../../..';
+         } else {
+             // Package installation
+             basePath = '../../../';
+         }
+     }
  
      require('load-grunt-config')(grunt, {
-         configPath: path.join(process.cwd(), 'build/grunt/config'),
+         configPath: path.join(cwd, 'build/grunt/config'),
          data: {
              paths: {
                  grunt:    'build/grunt',
                  npm:      'node_modules',
                  composer: 'vendor',
                  dist:     'assets/dist',
-                 prod:     '../../../../../www/assets/admin',
+                 prod:     basePath + '/www/assets/admin',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants