Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cplace/cli

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cplace/cli - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

.idea/inspectionProfiles/Project_Default.xml

9

dist/src/commands/repos/UpdateRepos.js

@@ -28,3 +28,10 @@ "use strict";

.then(() => repo.checkoutBranch(branch))
.then(() => repo.checkoutCommit(commit))
.then(() => {
if (commit) {
return repo.checkoutCommit(commit);
}
else {
return repo.pullOnlyFastForward();
}
})
.then(() => repo.resetHard())

@@ -31,0 +38,0 @@ .then(() => {

@@ -18,4 +18,5 @@ /**

checkoutCommit(commit: string): Promise<void>;
pullOnlyFastForward(): Promise<void>;
resetHard(): Promise<void>;
getCurrentCommitHash(): Promise<string>;
}

@@ -120,2 +120,24 @@ "use strict";

}
pullOnlyFastForward() {
return this.status()
.then(({ tracking }) => {
const i = tracking.indexOf('/');
if (i < 0) {
return Promise.reject(`cannot determine remote and branch for ${tracking}`);
}
const remote = tracking.substring(0, i);
const branch = tracking.substr(i + 1);
Global_1.Global.isVerbose() && console.log(`pulling branch ${branch} from remote ${remote}`);
return new Promise((resolve, reject) => {
this.git.pull(remote, branch, { '--ff-only': true }, (err) => {
if (err) {
reject(err);
}
else {
resolve();
}
});
});
});
}
resetHard() {

@@ -128,3 +150,3 @@ return new Promise((resolve, reject) => {

else {
Global_1.Global.isVerbose() && console.log(`repo ${this.repoName} has been resetted`);
Global_1.Global.isVerbose() && console.log(`repo ${this.repoName} has been reset`);
resolve();

@@ -131,0 +153,0 @@ }

2

package.json
{
"name": "@cplace/cli",
"version": "0.3.2",
"version": "0.3.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -36,3 +36,9 @@ /**

.then(() => repo.checkoutBranch(branch))
.then(() => repo.checkoutCommit(commit))
.then(() => {
if (commit) {
return repo.checkoutCommit(commit);
} else {
return repo.pullOnlyFastForward();
}
})
.then(() => repo.resetHard())

@@ -39,0 +45,0 @@ .then(() => {

@@ -130,2 +130,26 @@ /**

public pullOnlyFastForward(): Promise<void> {
return this.status()
.then(({tracking}) => {
const i = tracking.indexOf('/');
if (i < 0) {
return Promise.reject(`cannot determine remote and branch for ${tracking}`);
}
const remote = tracking.substring(0, i);
const branch = tracking.substr(i + 1);
Global.isVerbose() && console.log(`pulling branch ${branch} from remote ${remote}`);
return new Promise((resolve, reject) => {
this.git.pull(remote, branch, {'--ff-only': true}, (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
});
}
public resetHard(): Promise<void> {

@@ -137,3 +161,3 @@ return new Promise<void>((resolve, reject) => {

} else {
Global.isVerbose() && console.log(`repo ${this.repoName} has been resetted`);
Global.isVerbose() && console.log(`repo ${this.repoName} has been reset`);
resolve();

@@ -140,0 +164,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc