Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async clone(url) {
await init(this.gitdir);
// await addRemote()
await GithubFetch({
gitdir: this.gitdir,
// TODO: make this not Github-specific
user: ghurl(url).user,
repo: ghurl(url).repo,
ref: ghurl(url).branch,
remote: this.operateRemote,
token: this.operateToken
});
await checkout({
workdir: this.workdir,
gitdir: this.gitdir,
// TODO: make this not Github-specific
ref: ghurl(url).branch,
remote: this.operateRemote
});
}
async list() {
return new Promise((resolve, reject) => {
if (repository && 'url' in repository) {
let ghObject = gh(repository.url);
let repoName = `${ghObject.user}/${ghObject.repo}`;
if (!this.repos.has(repoName)) {
this.repos.add(repoName);
setTimeout(()=> {
this.ghme.star(repoName, error => {
this.total++;
if (!error) {
this.success++;
console.log('✅ ' + colors.yellow('Add ⭐ to ')+colors.yellow.underline(repoName));
} else {
this.errors++;
// let data = { repo: repoName, message: error.message, code: error.statusCode };
console.log(`❌ ${colors.yellow('Add ⭐ to ')} ${colors.yellow.underline(repoName)} ${colors.red(` error: ${error.message}`)}`);
}
resolve(this.total);
});
async clone(url) {
await init(this.gitdir);
// await addRemote()
await GithubFetch({
gitdir: this.gitdir,
// TODO: make this not Github-specific
user: ghurl(url).user,
repo: ghurl(url).repo,
ref: ghurl(url).branch,
remote: this.operateRemote,
token: this.operateToken
});
await checkout({
workdir: this.workdir,
gitdir: this.gitdir,
// TODO: make this not Github-specific
ref: ghurl(url).branch,
remote: this.operateRemote
});
}
async list() {
console.log('Releasing: '.cyan + 'bower package'.green);
releaseAdRepo(bowerRepo, bowerRoot, tmpBowerRepo, vVersion);
console.log('Released: '.cyan + 'bower package'.green);
} else {
console.log('The "bowerRepo" is not set in package.json. Skipping Bower package publishing.'.yellow);
}
// bower (register package if bower.json is located in this repo)
if (bowerjson) {
if (bowerjson.private) {
console.log('Package is private, skipping bower registration'.yellow);
} else if (!which('bower')) {
console.log('Bower is not installed globally, skipping bower registration'.yellow);
} else {
console.log('Registering: '.cyan + 'bower package'.green);
const output = safeRun(`bower register ${bowerjson.name} ${gh(repo).clone_url}`, true);
if (output.indexOf('EDUPLICATE') > -1) {
console.log('Package already registered'.yellow);
} else if (output.indexOf('registered successfully') < 0) {
console.log('Error registering package, details:'.red);
console.log(output.red);
} else {
console.log('Registered: '.cyan + 'bower package'.green);
}
}
}
}
// documents site
if (!isPrivate && docsRepo && (!preid || argv.onlyDocs)) {
console.log('Releasing: '.cyan + 'documents site'.green);
async clone(url) {
await init(this.gitdir);
// await addRemote()
await GithubFetch({
gitdir: this.gitdir,
// TODO: make this not Github-specific
user: ghurl(url).user,
repo: ghurl(url).repo,
ref: ghurl(url).branch,
remote: this.operateRemote,
token: this.operateToken
});
await checkout({
workdir: this.workdir,
gitdir: this.gitdir,
// TODO: make this not Github-specific
ref: ghurl(url).branch,
remote: this.operateRemote
});
}
async list() {
fetchReadMe() {
const { repository } = this.props;
const { user: owner, repo } = gh(repository.url);
const github = octokit({});
const opts = {
owner,
repo,
headers: {
Accept: 'application/vnd.github.v3.html',
},
};
github.repos.getReadme(opts)
.then(({ data }) => this.setState({
isLoading: false,
data,
}))
.catch(error => this.setState({
.then(result => {
const pkg = result.pkg
if (!pkg) {
return {}
}
return {
pkg,
pkgRoot: path.dirname(result.path),
repo: pkg.repository && pkg.repository.url && gh(pkg.repository.url),
}
})
.then(opts => Object.assign(opts, {filePath}))
return undefined;
}
const createdOn = new Date(npmResult.created);
if (!npmResult.modified) {
this.app.log.warning(`Package '${name}' doesn't have an updated date`);
return undefined;
}
const updatedOn = new Date(npmResult.modified);
const npmURL = this.npmWebsitePackageURL + name;
let gitHubResult, parsedGitHubURL, gitHubURL;
if (npmResult.repository) {
if (npmResult.repository.includes('github')) {
parsedGitHubURL = parseGitHubURL(npmResult.repository);
if (parsedGitHubURL) {
gitHubURL = parsedGitHubURL.https_url;
gitHubResult = await this.fetchGitHubRepository(parsedGitHubURL.user, parsedGitHubURL.repo);
} else {
this.app.log.debug(`'${name}' package has an invalid GitHub URL (${npmResult.repository})`);
}
} else {
this.app.log.debug(`'${name}' package has a respository not hosted by GitHub (${npmResult.repository})`);
}
} else {
this.app.log.debug(`'${name}' package doesn't have a respository field`);
}
let gitHubStars, gitHubPackageJSON, gitHubPackageJSONPath;
if (gitHubResult) {
let defaultPath = currentPackage && currentPackage.gitHubPackageJSONPath;