Skip to content

Commit 7ce8213

Browse files
committed
Copying over whole directory
Unsure about the affects on testing, so checking in now just in case
1 parent 577479d commit 7ce8213

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lib/utils.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports.pathBasename = pathBasename
55
module.exports.getFullUri = getFullUri
66
module.exports.hasSuffix = hasSuffix
77
module.exports.parse = parse
8-
module.exports.processHandlebarFile = processHandlebarFile
98
module.exports.serialize = serialize
109
module.exports.translate = translate
1110
module.exports.stringToStream = stringToStream
@@ -14,6 +13,8 @@ module.exports.debrack = debrack
1413
module.exports.stripLineEndings = stripLineEndings
1514
module.exports.fullUrlForReq = fullUrlForReq
1615
module.exports.routeResolvedFile = routeResolvedFile
16+
module.exports.processHandlebarFile = processHandlebarFile
17+
module.exports.copyTemplateDir = copyTemplateDir
1718

1819
const fs = require('fs-extra')
1920
const path = require('path')
@@ -198,6 +199,16 @@ function processHandlebarTemplate (source, substitutions) {
198199
}
199200
}
200201

202+
async function copyTemplateDir (templatePath, targetPath) {
203+
return new Promise((resolve, reject) => {
204+
fs.copy(templatePath, targetPath, (error) => {
205+
if (error) { return reject(error) }
206+
207+
resolve()
208+
})
209+
})
210+
}
211+
201212
function serialize (graph, baseUri, contentType, callback) {
202213
try {
203214
// target, kb, base, contentType, callback

test/integration/auth-proxy-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path')
33
const nock = require('nock')
44
const request = require('supertest')
55
const { expect } = require('chai')
6-
const rm = require('../utils').rm
6+
const rmDir = require('../utils').rmDir
77

88
const USER = 'https://ruben.verborgh.org/profile/#me'
99

@@ -32,8 +32,7 @@ describe('Auth Proxy', () => {
3232
// Release back-end server
3333
nock.cleanAll()
3434
// Remove created index files
35-
rm('index.html')
36-
rm('index.html.acl')
35+
rmDir()
3736
})
3837

3938
describe('responding to /server/a', () => {

0 commit comments

Comments
 (0)