Skip to content

Commit

Permalink
Normalisation de la signature de createDefaultRepository et tentative…
Browse files Browse the repository at this point in the history
… de correction de la création de repo sur gitlab
  • Loading branch information
DavidBruant committed Dec 8, 2024
1 parent 333ca59 commit 0523272
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 3 additions & 5 deletions assets/scripts/actions/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,11 @@ export const createRepositoryForCurrentAccount = async (repoName, template) => {
return (
getOAuthServiceAPI()
.createDefaultRepository(scribouilliGitRepo, template)
.then(({repoId, cloneUrl}) => {
console.log('cloneUrl', cloneUrl)
console.log('cloneUrl || `${origin}/${repoId}.git`', cloneUrl || `${origin}/${repoId}.git`)
.then(({remoteURL}) => {

const gitAgent = new GitAgent({
repoId: repoId || makeRepoId(owner, escapedRepoName),
remoteURL: cloneUrl || `${origin}/${repoId}.git`,
repoId: makeRepoId(owner, escapedRepoName),
remoteURL: remoteURL,
onMergeConflict : (/** @type {import("./../store.js").ResolutionOption[] | undefined} */ resolutionOptions) => {
store.mutations.setConflict(resolutionOptions)
},
Expand Down
4 changes: 2 additions & 2 deletions assets/scripts/oauth-services-api/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class GitHubAPI {
},
)
.then(r => r.json())
.then(({url: newRepoAPIURL, clone_url: cloneUrl, full_name: repoId}) => {
.then(({url: newRepoAPIURL, clone_url}) => {
// Activate GitHub Pages
return this.callAPI(`${newRepoAPIURL}/pages`, {
method: 'POST',
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class GitHubAPI {
})
})
})
.then(() => { return {repoId, cloneUrl} })
.then(() => ({remoteURL: clone_url}))

})
}
Expand Down
4 changes: 3 additions & 1 deletion assets/scripts/oauth-services-api/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export default class GitLabAPI {
topics: ['site-scribouilli'],
visibility: 'public',
}),
}).then(response => response.json())
})
.then(response => response.json())
.then(({http_url_to_repo}) => ({remoteURL: http_url_to_repo}))
}

/** @type {OAuthServiceAPI["deploy"]} */
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @property {() => {username: string, password: string}} getOauthUsernameAndPassword
* @property {() => Promise<any>} getAuthenticatedUser
* @property {() => Promise<AuthenticatedUserEmails[]>} getUserEmails
* @property {(scribouilliGitRepo: ScribouilliGitRepo, template: GitSiteTemplate) => Promise<any>} createDefaultRepository
* @property {(scribouilliGitRepo: ScribouilliGitRepo, template: GitSiteTemplate) => Promise<{remoteURL: string}>} createDefaultRepository
* @property {(scribouilliGitRepo: ScribouilliGitRepo) => Promise<boolean>} isRepositoryReady
* @property {() => Promise<GithubRepository[]>} getCurrentUserRepositories
* @property {(scribouilliGitRepo: ScribouilliGitRepo) => Promise<any>} deploy
Expand Down

0 comments on commit 0523272

Please sign in to comment.