diff --git a/.gitignore b/.gitignore index 98c014e2..cce4abcf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ apps/ dist/ debug/ release/ + +# artefacts for Visual Studio Code +/.vscode/ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index e5a115e7..9eaea51b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -67,6 +67,27 @@ function getPlatforms() { return platforms; } +function getRunDebugAppCommand() { + switch (os.platform()) { + case 'darwin': + return 'open ' + path.join(debugDir, pkg.name, 'osx64', pkg.name + '.app'); + + break; + case 'linux': + return path.join(debugDir, pkg.name, 'linux64', pkg.name); + + break; + case 'win32': + return path.join(debugDir, pkg.name, 'win32', pkg.name + '.exe'); + + break; + + default: + return ''; + break; + } +} + function get_release_filename(platform, ext) { return 'Betaflight-Configurator_' + platform + '_' + pkg.version + '.' + ext; } @@ -275,6 +296,10 @@ gulp.task('debug', ['dist', 'clean-debug'], function (done) { process.exit(1); }); } + var exec = require('child_process').exec; + var run = getRunDebugAppCommand(); + console.log('Starting debug app (' + run + ')...'); + exec(run); done(); }); });