Skip to content

Commit

Permalink
Using the new Laravel 9 path
Browse files Browse the repository at this point in the history
  • Loading branch information
luisdalmolin committed Mar 6, 2022
1 parent bb6b4ea commit 214851e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion all.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const phpLoader = require('./php-loader');
Expand All @@ -14,7 +15,11 @@ module.exports = function (indexContent) {
} catch (e) { }

if (path.dirname(this.resource).includes(path.dirname(loaderPath))) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'lang';

if (! fs.existsSync(baseDirectory)) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
}
} else {
baseDirectory = path.dirname(this.resource);
}
Expand Down
6 changes: 5 additions & 1 deletion json.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ module.exports = function (indexContent) {
} catch (e) { }

if (path.dirname(this.resource).includes(path.dirname(loaderPath))) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'lang';

if (! fs.existsSync(baseDirectory)) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
}
} else {
baseDirectory = path.dirname(this.resource);
}
Expand Down
6 changes: 5 additions & 1 deletion php.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ module.exports = function (indexContent) {
} catch (e) { }

if (path.dirname(this.resource).includes(path.dirname(loaderPath))) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'lang';

if (! fs.existsSync(baseDirectory)) {
baseDirectory = path.dirname(this.resource) + path.sep + '..' + path.sep + '..' + path.sep + '..' + path.sep + 'resources' + path.sep + 'lang';
}
} else {
baseDirectory = path.dirname(this.resource);
}
Expand Down

1 comment on commit 214851e

@sebastiaanluca
Copy link

Choose a reason for hiding this comment

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

@luisdalmolin v1.4 doesn't seem to be available on npm yet. Does that take a while?

Please sign in to comment.