File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 22
33const options = require ( './options' )
44const fs = require ( 'fs' )
5+ const path = require ( 'path' )
56const { loadConfig } = require ( './cli-utils' )
67const { red, bold } = require ( 'colorette' )
78
@@ -84,10 +85,7 @@ function bin (argv, server) {
8485
8586 // Overwrite root .acl if owner is specified
8687 if ( argv . owner ) {
87- let rootPath = argv . root
88- if ( ! rootPath ) {
89- rootPath = process . cwd ( )
90- }
88+ let rootPath = path . resolve ( argv . root || process . cwd ( ) )
9189 if ( ! ( rootPath . endsWith ( '/' ) ) ) {
9290 rootPath += '/'
9391 }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ function createApp (argv = {}) {
4545
4646 argv . resourceMapper = new ResourceMapper ( {
4747 rootUrl : argv . serverUri ,
48- rootPath : argv . root || process . cwd ( ) ,
48+ rootPath : path . resolve ( argv . root || process . cwd ( ) ) ,
4949 includeHost : argv . multiuser ,
5050 defaultContentType : argv . defaultContentType
5151 } )
@@ -64,6 +64,7 @@ function createApp (argv = {}) {
6464
6565 // Serve the public 'common' directory (for shared CSS files, etc)
6666 app . use ( '/common' , express . static ( path . join ( __dirname , '../common' ) ) )
67+ routeResolvedFile ( app , '/common/js/' , 'mashlib/dist/mashlib.js' )
6768 routeResolvedFile ( app , '/common/js/' , 'mashlib/dist/mashlib.min.js' )
6869 routeResolvedFile ( app , '/common/js/' , 'mashlib/dist/mashlib.min.js.map' )
6970 routeResolvedFile ( app , '/common/js/' , 'solid-auth-client/dist-lib/solid-auth-client.bundle.js' )
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ describe('LDNODE params', function () {
5656 var server = supertest ( ldp )
5757
5858 it ( 'should fallback on current working directory' , function ( ) {
59- assert . equal ( ldp . locals . ldp . resourceMapper . _rootPath , './test/resources' )
59+ assert . equal ( ldp . locals . ldp . resourceMapper . _rootPath , path . resolve ( './test/resources' ) )
6060 } )
6161
6262 it ( 'should find resource in correct path' , function ( done ) {
You can’t perform that action at this time.
0 commit comments