Created
January 20, 2019 22:23
-
-
Save Karrq/24befc7848fc7cff1862b498a3a51c6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.execute = async (args) => { | |
| // args => https://egodigital.github.io/vscode-powertools/api/interfaces/_contracts_.workspacecommandscriptarguments.html | |
| // s. https://code.visualstudio.com/api/references/vscode-api | |
| const vscode = args.require('vscode'); | |
| const vscode_helpers = args.require('vscode-helpers'); | |
| vscode.window.showInformationMessage( | |
| 'Generating new Stack project...' | |
| ); | |
| const project_name = await vscode.window.showInputBox({ 'placeHolder' : 'haskellProject', 'prompt' : 'Insert project name', 'value': 'haskellProject'}); | |
| const project_template = await vscode.window.showInputBox({ 'placeHolder' : 'haskell template', 'prompt' : 'Insert template name', 'value': 'new-template'}); | |
| if ((project_name == undefined) || (project_template == undefined)){ | |
| return; | |
| } | |
| await vscode_helpers.execFile('chdir', [args.replaceValues("${workspaceRoot}\\..\\")]).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("chdir"); | |
| await vscode_helpers.execFile('mkdir', ['test']).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("mkdir"); | |
| await vscode_helpers.execFile('stack', ['new', project_name, project_template]).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("stack new"); | |
| await vscode_helpers.execFile('chdir', ['.\\'+project_name]).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("chdir"); | |
| await vscode_helpers.execFile('stack', ['setup']).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("stack setup"); | |
| await vscode_helpers.execFile('stack', ['build']).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("stack build"); | |
| await vscode_helpers.execFile('stack', ['build', 'intero']).then(function(v){}, function(v){}); | |
| //vscode.window.showInformationMessage("stack build intero"); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
s. issue #6 @ vscode-powertools