MCPcopy
hub / github.com/iterative/cml / constructor

Method constructor

src/cml.js:124–135  ·  view source on GitHub ↗
(opts = {})

Source from the content-addressed store, hash-verified

122
123class CML {
124 constructor(opts = {}) {
125 fixGitSafeDirectory(); // https://github.com/iterative/cml/issues/970
126
127 const { driver, repo, token } = opts;
128
129 this.repo = uriNoTrailingSlash(repo || gitRemoteUrl()).replace(
130 /\.git$/,
131 ''
132 );
133 this.token = token || inferToken();
134 this.driver = driver || inferDriver({ repo: this.repo });
135 }
136
137 async revParse({ ref = 'HEAD' } = {}) {
138 try {

Callers

nothing calls this directly

Calls 5

fixGitSafeDirectoryFunction · 0.85
uriNoTrailingSlashFunction · 0.85
gitRemoteUrlFunction · 0.85
inferTokenFunction · 0.85
inferDriverFunction · 0.85

Tested by

no test coverage detected