Skip to content

Instantly share code, notes, and snippets.

@Karrq
Created January 20, 2019 22:23
Show Gist options
  • Select an option

  • Save Karrq/24befc7848fc7cff1862b498a3a51c6d to your computer and use it in GitHub Desktop.

Select an option

Save Karrq/24befc7848fc7cff1862b498a3a51c6d to your computer and use it in GitHub Desktop.
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");
};
Copy link

ghost commented Jan 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment