-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #533 from tschaub/nojekyll-cname
Add --nojekyll and --cname options
- Loading branch information
Showing
20 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const helper = require('../helper.js'); | ||
const ghPages = require('../../lib/index.js'); | ||
const path = require('path'); | ||
|
||
const fixtures = path.join(__dirname, 'fixtures'); | ||
const fixtureName = 'cname'; | ||
|
||
beforeEach(() => { | ||
ghPages.clean(); | ||
}); | ||
|
||
describe('the --cname option', () => { | ||
it('adds a CNAME file', (done) => { | ||
const local = path.join(fixtures, fixtureName, 'local'); | ||
const expected = path.join(fixtures, fixtureName, 'expected'); | ||
const branch = 'gh-pages'; | ||
|
||
helper.setupRemote(fixtureName, {branch}).then((url) => { | ||
const options = { | ||
repo: url, | ||
user: { | ||
name: 'User Name', | ||
email: '[email protected]', | ||
}, | ||
cname: 'custom-domain.com', | ||
}; | ||
ghPages.publish(local, options, (err) => { | ||
if (err) { | ||
return done(err); | ||
} | ||
helper | ||
.assertContentsMatch(expected, url, branch) | ||
.then(() => done()) | ||
.catch(done); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
custom-domain.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
test/integration/fixtures/nojekyll-exists/expected/hello-world.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
1 change: 1 addition & 0 deletions
1
test/integration/fixtures/nojekyll-exists/local/hello-world.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World! |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const helper = require('../helper.js'); | ||
const ghPages = require('../../lib/index.js'); | ||
const path = require('path'); | ||
|
||
const fixtures = path.join(__dirname, 'fixtures'); | ||
const fixtureName = 'nojekyll'; | ||
|
||
beforeEach(() => { | ||
ghPages.clean(); | ||
}); | ||
|
||
describe('the --nojekyll option', () => { | ||
it('adds a .nojekyll file', (done) => { | ||
const local = path.join(fixtures, fixtureName, 'local'); | ||
const expected = path.join(fixtures, fixtureName, 'expected'); | ||
const branch = 'gh-pages'; | ||
|
||
helper.setupRemote(fixtureName, {branch}).then((url) => { | ||
const options = { | ||
repo: url, | ||
user: { | ||
name: 'User Name', | ||
email: '[email protected]', | ||
}, | ||
nojekyll: true, | ||
}; | ||
ghPages.publish(local, options, (err) => { | ||
if (err) { | ||
return done(err); | ||
} | ||
helper | ||
.assertContentsMatch(expected, url, branch) | ||
.then(() => done()) | ||
.catch(done); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const helper = require('../helper.js'); | ||
const ghPages = require('../../lib/index.js'); | ||
const path = require('path'); | ||
|
||
const fixtures = path.join(__dirname, 'fixtures'); | ||
const fixtureName = 'nojekyll-exists'; | ||
|
||
beforeEach(() => { | ||
ghPages.clean(); | ||
}); | ||
|
||
describe('the --nojekyll option', () => { | ||
it('works even if the .nojekyll file already exists', (done) => { | ||
const local = path.join(fixtures, fixtureName, 'local'); | ||
const expected = path.join(fixtures, fixtureName, 'expected'); | ||
const branch = 'gh-pages'; | ||
|
||
helper.setupRemote(fixtureName, {branch}).then((url) => { | ||
const options = { | ||
repo: url, | ||
user: { | ||
name: 'User Name', | ||
email: '[email protected]', | ||
}, | ||
nojekyll: true, | ||
}; | ||
ghPages.publish(local, options, (err) => { | ||
if (err) { | ||
return done(err); | ||
} | ||
helper | ||
.assertContentsMatch(expected, url, branch) | ||
.then(() => done()) | ||
.catch(done); | ||
}); | ||
}); | ||
}); | ||
}); |