Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
fix env workdir to be in root project and not bfast ui root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuamshana committed Mar 5, 2021
1 parent 34ac77c commit e4b0d32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions assets/js/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function startTerminal(project) {
bfastTerminal.open(document.getElementById('terminal'));
bfastTerminal.prompt = () => {
bfastTerminal.write(`\n${END_OF_LINE} `);
finishExecute = true;
};
bfastTerminal.help = () => {
bfastTerminal.writeln('');
Expand All @@ -79,7 +80,7 @@ function startTerminal(project) {
}
}

bfastTerminal.writeln('bfast ui shell.');
// bfastTerminal.writeln('bfast ui shell.');
bfastTerminal.prompt();
bfastTerminal.textarea.onkeydown = function (ev) {
const printable = ev.key.length === 1;
Expand Down Expand Up @@ -115,21 +116,23 @@ function startTerminal(project) {
}
terminalEvents.listener(response => {
const msg = response.body;
// if (finishExecute === false) {
// } else {
if (msg.toString().trim() === prevCommand.toString().trim()) {
prevCommand = '';
// console.log(msg.toString().trim());
// finishExecute = msg.toString().trim().includes(END_OF_LINE.trim());
} else if (msg.toString().trim() === 'no') {
finishExecute = true;
bfastTerminal.prompt();
prevCommand = '';
} else if (msg.toString().trim() === '^C') {
finishExecute = true;
prevCommand = '';
bfastTerminal.prompt();
} else {
bfastTerminal.write(msg);
// console.log(msg.toString().trim());
finishExecute = msg.toString().trim().includes(END_OF_LINE.trim());
}
// }
finishExecute = msg.toString().trim() === END_OF_LINE.trim();
});
localStorage.setItem('terminal', 'open');
} else {
Expand Down
3 changes: 2 additions & 1 deletion functions/events/terminal.event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import bfastnode from "bfastnode";
import {StorageUtil} from "../utils/storage.util.mjs";
import {platform} from 'os';
import {spawn} from 'node-pty-prebuilt-multiarch';
import {resolve} from 'path';

const shell = platform() === 'win32' ? 'cmd.exe' : 'bash';
const terminals = {};
Expand All @@ -16,7 +17,7 @@ function initiateTerm(project, path, response) {
name: 'bfast-terminal',
cols: 1000,
rows: 700,
cwd: path,
cwd: resolve(path, '../../'),
env: process.env
});
terminals[project].on('data', function (data) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfast-ui-ng",
"version": "0.0.1-alpha.9",
"version": "0.0.1-alpha.10",
"main": "bfast-ui-angular.common.js",
"module": "bfast-ui-angular.mjs",
"scripts": {
Expand Down

0 comments on commit e4b0d32

Please sign in to comment.