fix(core): update
This commit is contained in:
parent
321ce99338
commit
c021a84788
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-catalog',
|
||||
version: '1.0.275',
|
||||
version: '1.0.276',
|
||||
description: 'website for lossless.com'
|
||||
}
|
||||
|
@ -39,10 +39,6 @@ export class DeesSimpleAppDash extends DeesElement {
|
||||
@property()
|
||||
public viewTabs: IView[] = [];
|
||||
|
||||
@property()
|
||||
public views: Array<{ name: string; icon: string; viewFunction: () => Promise<TemplateResult> }> =
|
||||
[];
|
||||
|
||||
public static styles = [
|
||||
cssManager.defaultStyles,
|
||||
css`
|
||||
|
@ -27,6 +27,9 @@ export class DeesTerminal extends DeesElement {
|
||||
// INSTANCE
|
||||
private resizeObserver: ResizeObserver;
|
||||
|
||||
@property()
|
||||
public setupCommand = `pnpm install @git.zone/tsbuild && clear && echo 'welcome'`;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.resizeObserver = new ResizeObserver((entries) => {
|
||||
@ -278,8 +281,9 @@ export class DeesTerminal extends DeesElement {
|
||||
term.onData((data) => {
|
||||
input.write(data);
|
||||
});
|
||||
await domtools.convenience.smartdelay.delayFor(5000);
|
||||
input.write(`pnpm add isomorphic-git @git.zone/tsbuild\n`);
|
||||
await this.waitForPrompt(term, '~/');
|
||||
input.write(this.setupCommand);
|
||||
input.write(`\n`);
|
||||
}
|
||||
|
||||
async connectedCallback(): Promise<void> {
|
||||
@ -295,4 +299,22 @@ export class DeesTerminal extends DeesElement {
|
||||
handleResize() {
|
||||
this.fitAddon.fit();
|
||||
}
|
||||
|
||||
private async waitForPrompt(term: Terminal, prompt: string): Promise<void> {
|
||||
return new Promise<void>((resolve) => {
|
||||
const checkPrompt = () => {
|
||||
const lines = term.buffer.active;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines.getLine(i);
|
||||
if (line && line.translateToString().includes(prompt)) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
}
|
||||
setTimeout(checkPrompt, 100); // check every 100 ms
|
||||
};
|
||||
|
||||
checkPrompt();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user