支持在部署到github的配置里,使用 cname 字段来设置 CNAME
This commit is contained in:
parent
ab70d8073f
commit
2611f1dc82
15
deploy.js
15
deploy.js
@ -388,7 +388,6 @@ function deployToGit (connection) {
|
|||||||
.exists(deployDir)
|
.exists(deployDir)
|
||||||
.then(function (exist) {
|
.then(function (exist) {
|
||||||
if (exist) return
|
if (exist) return
|
||||||
|
|
||||||
console.info('Setting up Git deployment...')
|
console.info('Setting up Git deployment...')
|
||||||
return setup()
|
return setup()
|
||||||
})
|
})
|
||||||
@ -458,10 +457,13 @@ function deployToGit (connection) {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (connection.cname) {
|
if (connection.cname) {
|
||||||
console.info('Adding CNAME')
|
console.info(`Adding CNAME [${connection.cname}]`)
|
||||||
return fs.writeFile('CNAME', connection.cname, { flag: 'w' }, err => {
|
return fs.writeFile(
|
||||||
console.error(err)
|
path.join(deployDir, 'CNAME'),
|
||||||
})
|
connection.cname,
|
||||||
|
{ flag: 'w' },
|
||||||
|
console.error
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
@ -469,8 +471,7 @@ function deployToGit (connection) {
|
|||||||
return parseConnection(connection)
|
return parseConnection(connection)
|
||||||
})
|
})
|
||||||
.each(function (repo) {
|
.each(function (repo) {
|
||||||
console.log('########## repo ###########')
|
console.info('##########', repo, '##########')
|
||||||
console.info(repo)
|
|
||||||
return push(repo)
|
return push(repo)
|
||||||
})
|
})
|
||||||
} // end of function exec
|
} // end of function exec
|
||||||
|
Loading…
Reference in New Issue
Block a user