1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-28 08:50:22 +00:00

confirmation before github pull

This commit is contained in:
Steven Hugg 2019-05-20 15:21:38 -04:00
parent c99a066f99
commit 320e0c02a4
2 changed files with 11 additions and 4 deletions

View File

@ -353,6 +353,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<p>Enter the GitHub repository URL:</p>
<p><input id="importGithubURL" size="60" placeholder="https://github.com/user/repo"></input></p>
<p>If the project is compatible with 8bitworkshop, it should build automatically.</p>
<p>Source files must be in the root folder of the repository.</p>
<p><button type="button" class="btn btn-primary" id="importGithubButton">Import Project</button></p>
</div>
<div class="modal-footer">

View File

@ -77,9 +77,11 @@ var TOOL_TO_SOURCE_STYLE = {
function alertError(s:string) {
if (ga) ga('send', 'event', 'error', 'error', s);
setWaitDialog(false);
bootbox.alert(s);
}
function alertInfo(s:string) {
setWaitDialog(false);
bootbox.alert(s);
}
@ -518,12 +520,16 @@ function _pushProjectToGithub(e) {
function _pullProjectFromGithub(e) {
var ghurl = getBoundGithubURL();
if (!ghurl) return;
bootbox.confirm("Pull from repository and replace all local files?", (ok) => {
if (ok) {
setWaitDialog(true);
getGithubService().pull(ghurl).then( (sess:GHSession) => {
setWaitDialog(false);
projectWindows.updateAllOpenWindows(store);
});
}
});
}
function confirmCommit(sess) : Promise<GHSession> {
return new Promise( (resolve, reject) => {