Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main() {
ghpages.publish(config.output.path,
// needed when running on travis-ci
{
user: {
name: 'Steve Schwarz',
email: 'steve@agilitynerd.com'
},
repo: 'https://' + process.env.GH_TOKEN + '@' + process.env.GH_REF
},
console.error.bind(console));
}
const options = {
logger: logger,
remote: GIT_REMOTE_NAME,
message: COMMIT_MESSAGE,
dotfiles: true // for .nojekyll
};
/**
* Since GitHub moved to Jekyll 3.3, their server ignores the "node_modules" and "vendors" folder by default.
* but, as of now, it also ignores "vendors*" files.
* This means vendor.bundle.js or vendor.[chunk].bundle.js will return 404.
* this is the fix for now.
*/
fs.writeFileSync(path.join(webpackConfig.output.path, ".nojekyll"), "");
const ghpages = require("gh-pages");
ghpages.publish(webpackConfig.output.path, options, function(err) {
if (err) {
console.log("GitHub deployment done. STATUS: ERROR.");
throw err;
} else {
console.log("GitHub deployment done. STATUS: SUCCESS.");
}
});
});
}
var ghpages = require('gh-pages');
const shell = require('shelljs');
const chalk = require('chalk');
shell.rm('-rf', './demo');
shell.mkdir('-p','./demo/dist');
shell.mkdir('-p','./demo/example');
shell.cp('-Rf', './example/*', './demo/example');
shell.cp('-Rf', './dist/*', './demo/dist');
// 发布
ghpages.publish('./demo', {
branch: 'gh-pages',
}, (err) => {
if(err) {
console.log(chalk.red(err));
} else {
shell.rm('-rf', './demo');
console.log(chalk.green('demo同步完成!'));
}
});
remote: GIT_REMOTE_NAME,
message: COMMIT_MESSAGE,
dotfiles: true // for .nojekyll
};
/**
* Since GitHub moved to Jekyll 3.3, their server ignores the "node_modules" and "vendors" folder by default.
* but, as of now, it also ignores "vendors*" files.
* This means vendor.bundle.js or vendor.[chunk].bundle.js will return 404.
* this is the fix for now.
*/
fs.writeFileSync(path.join(webpackConfig.output.path, '.nojekyll'), '');
execSync(`npm run docs -- -d ${webpackConfig.output.path}/documentation`, {stdio:[0,1,2]});
const ghpages = require('gh-pages');
ghpages.publish(webpackConfig.output.path, options, function(err) {
if (err) {
console.log('GitHub deployment done. STATUS: ERROR.');
throw err;
} else {
console.log('GitHub deployment done. STATUS: SUCCESS.');
}
});
});
}
// If we are running inside Travis, send the token
if (process.env.GH_TOKEN) {
options.repo = 'https://' + process.env.GH_TOKEN + '@github.com/odecee/generator-confit.git';
// Add some user information for the gh-pages commit
options.user = {
email: 'gh-pages@github',
name: 'GH Pages Committer'
};
}
// END_CONFIT_GENERATED_CONTENT
// START_CONFIT_GENERATED_CONTENT
ghpages.publish(docOutputDir, options, callback);
// END_CONFIT_GENERATED_CONTENT
// cp.exec('npm run docs', err => {
// if (!err) {
// ghPages.publish('./docs/_book', err => {
// if (!err) {
// spinner.succeed('Publish successfully.')
// } else {
// spinner.fail(err)
// }
// })
// } else {
// spinner.fail(err)
// }
// })
const spinner = ora("Publishing gitbooks...").start();
ghPages.publish("./docs/_book", err => {
if (!err) {
spinner.succeed("Publish successfully.");
} else {
spinner.fail(err);
}
});
}
#!/usr/bin/env node
var ghpages = require('gh-pages');
var path = require('path');
var packageInfo = require(path.join(__dirname, '..', 'package.json'));
var options = {
src: [
'bin/filters.js',
'bin/filters.js.map',
'examples/**/*',
'docs/**/*'
],
message: packageInfo.version
};
ghpages.publish(process.cwd(), options, function(err) {
if (err) {
console.log(err);
process.exit(1);
return;
}
process.exit(0);
});
)} All files will be Published in https://YOUR_TOKEN@github.com/${
github.username
}/${github.repo}.git`
)
} else {
remoteURL = `git@github.com:${github.username}/${github.repo}.git`
console.log(
`${chalk.blue('info')} All files will be Published in git@github.com:${
github.username
}/${github.repo}.git`
)
}
console.log(`${chalk.blue('info')} Branch: ${github.branch || 'gh-pages'}`)
ghpages.publish(
path.resolve(__dirname, '../public'),
{
branch: github.branch,
repo: remoteURL,
message: `:sparkles: Site updated at ${date}`,
dotfiles: true,
},
err => {
if (err) {
console.error(err)
process.exit(1)
}
console.log(`${chalk.green('success')} Published.`)
console.log(
`${chalk.green('success')} Visit https://github.com/${github.username}/${
const ghpages = require('gh-pages')
const { variables } = require('../common')
const { owner, repo, token } = variables;
const PUBLISH_CONFIG = {
repo: `https://${token}@github.com/${owner}/${repo}.git`,
silent: true,
}
console.log('Publishing docs to branch `gh-pages`...')
ghpages.publish(
'documentation',
PUBLISH_CONFIG,
(err) => {
if (err) {
console.error(err)
} else {
console.log('Docs have been published succesfully...')
}
})
'name of the branch you\'ll be pushing to', 'gh-pages')
.option('-o, --remote ',
'The name of the remote', 'origin')
.option('-m, --message ',
'commit message', 'Updates')
.option('-g, --tag ',
'add tag to commit')
.option('-t, --dotfiles', 'Include dotfiles')
.option('-a, --add', 'Only add, and never remove existing files.')
.option('-v, --remove