-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
348 additions
and
316 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,20 @@ | ||
const Step = require('../../actions').Step; | ||
const fs = require('node:fs'); | ||
|
||
const exec = async (req, action) => { | ||
const step = new Step('clearBareClone'); | ||
|
||
// Recursively remove the contents of ./.remote and ignore exceptions | ||
fs.rm('./.remote', { recursive: true, force: true }, (err) => { | ||
if (err) { | ||
throw err; | ||
} | ||
console.log(`.remote is deleted!`); | ||
}); | ||
|
||
action.addStep(step); | ||
return action; | ||
}; | ||
|
||
exec.displayName = 'clearBareClone.exec'; | ||
exports.exec = exec; |
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,26 @@ | ||
const fs = require('fs'); | ||
const chai = require('chai'); | ||
const clearBareClone = require('../src/proxy/processors/push-action/clearBareClone').exec; | ||
const pullRemote = require('../src/proxy/processors/push-action/pullRemote').exec; | ||
const { Action } = require('../src/proxy/actions/Action'); | ||
chai.should(); | ||
|
||
const expect = chai.expect; | ||
const timestamp = Date.now(); | ||
|
||
describe('clear bare and local clones', async () => { | ||
it('pull remote generates a local .remote folder', async () => { | ||
const action = new Action('123', 'type', 'get', timestamp, 'finos/git-proxy'); | ||
action.url = 'https://github.com/finos/git-proxy'; | ||
await pullRemote({}, action); | ||
|
||
expect(fs.existsSync(`./.remote/${timestamp}`)).to.be.true; | ||
}); | ||
|
||
it('clear bare clone function purges .remote folder and specific clone folder', async () => { | ||
const action = new Action('123', 'type', 'get', timestamp, 'finos/git-proxy'); | ||
await clearBareClone(null, action); | ||
expect(fs.existsSync(`./.remote`)).to.throw; | ||
expect(fs.existsSync(`./.remote/${timestamp}`)).to.throw; | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ npm install -g @finos/git-proxy-cli | |
To install a specific version of Git Proxy, append the version to the end of the install command: | ||
|
||
```bash | ||
npm install -g @finos/[email protected].0 | ||
npm install -g @finos/[email protected].1 | ||
``` | ||
|
||
To install a specific version of the Git Proxy CLI, append the version to the end of the install command: | ||
|
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
Oops, something went wrong.