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>Enter the GitHub repository URL:</p>
<p><input id="importGithubURL" size="60" placeholder="https://github.com/user/repo"></input></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>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> <p><button type="button" class="btn btn-primary" id="importGithubButton">Import Project</button></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

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