Skip to content

Commit a59ba16

Browse files
authored
Added Appveyor for Windows testing (#94)
1 parent 7cc31cc commit a59ba16

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

appveyor.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
environment:
2+
matrix:
3+
- nodejs_version: '6'
4+
- nodejs_version: '4'
5+
install:
6+
- ps: Install-Product node $env:nodejs_version
7+
- npm install
8+
matrix:
9+
fast_finish: true
10+
build: off
11+
shallow_clone: true
12+
test_script:
13+
- npm run test

src/preProcessPattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function preProcessPattern(globalRef, pattern) {
5757
.statAsync(pattern.absoluteFrom)
5858
.catch(() => {
5959
// If from doesn't appear to be a glob, then log a warning
60-
if (isGlob(pattern.from)) {
60+
if (isGlob(pattern.from) || pattern.from.indexOf('*') !== -1) {
6161
pattern.fromType = 'glob';
6262
} else {
6363
const msg = `unable to locate '${pattern.from}' at '${pattern.absoluteFrom}'`;

src/writeFile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export default function writeFile(globalRef, pattern, file) {
4848
// A hack because loaderUtils.interpolateName doesn't
4949
// find the right path if no directory is defined
5050
// ie. [path] applied to 'file.txt' would return 'file'
51-
if (file.relativeFrom.indexOf('/') < 0) {
52-
file.relativeFrom = '/' + file.relativeFrom;
51+
if (file.relativeFrom.indexOf(path.sep) < 0) {
52+
file.relativeFrom = path.sep + file.relativeFrom;
5353
}
5454

5555
file.webpackTo = loaderUtils.interpolateName(
@@ -60,7 +60,7 @@ export default function writeFile(globalRef, pattern, file) {
6060
// Add back removed dots
6161
if (dotRemoved) {
6262
let newBasename = path.basename(file.webpackTo);
63-
file.webpackTo = path.join(path.dirname(file.webpackTo), '.' + newBasename);
63+
file.webpackTo = path.dirname(file.webpackTo) + '/.' + newBasename;
6464
}
6565
}
6666

tests/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ describe('apply function', () => {
409409
runEmit({
410410
expectedAssetKeys: [],
411411
expectedErrors: [
412-
`[copy-webpack-plugin] unable to locate 'nonexistent.txt' at '${HELPER_DIR}/nonexistent.txt'`
412+
`[copy-webpack-plugin] unable to locate 'nonexistent.txt' at '${HELPER_DIR}${path.sep}nonexistent.txt'`
413413
],
414414
patterns: [{
415415
from: 'nonexistent.txt'
@@ -821,7 +821,7 @@ describe('apply function', () => {
821821
runEmit({
822822
expectedAssetKeys: [],
823823
expectedErrors: [
824-
`[copy-webpack-plugin] unable to locate 'nonexistent' at '${HELPER_DIR}/nonexistent'`
824+
`[copy-webpack-plugin] unable to locate 'nonexistent' at '${HELPER_DIR}${path.sep}nonexistent'`
825825
],
826826
patterns: [{
827827
from: 'nonexistent'

0 commit comments

Comments
 (0)