Skip to content

Commit

Permalink
add problematic local developments
Browse files Browse the repository at this point in the history
fix tui.ts
  • Loading branch information
TimurRin committed Jul 8, 2024
1 parent 4c34567 commit 88b8ceb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/actions/devcontainers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const JSON_NODEJS = {

const DOCKERFILE_NODEJS = `FROM docker.io/node:22.4.0
USER node`;
USER node
`;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const DOCKERFILE_NODEJS_INSTALL = `# Install Node.js
Expand Down
32 changes: 32 additions & 0 deletions src/tui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,44 @@ async function showLocalDevelopments() {
await promptMenu("\n[LOCAL DEVELOPMENTS]", options);
}

/**
*
*/
async function showProblematicLocalDevelopments() {
const options = [{ action: showDevelopmentsMenu, label: "Back" }];

const state = getInstance();

for (const development of state.developments) {
if (await checkExistence(development.fullPath)) {
await refreshDevelopmentState(development);
if (development.state != null && development.state.issues.length > 0) {
options.push({
action: async () => {
showDevelopmentActions(
development,
showProblematicLocalDevelopments,
);
},
label: `${getDevelopmentDisplayName(development)} (${(await getDevelopmentStatus(development)).join(", ")})`,
});
}
}
}

await promptMenu("\n[PROBLEMATIC LOCAL DEVELOPMENTS]", options);
}

/**
*
*/
async function showDevelopmentsMenu() {
await promptMenu("\n[DEVELOPMENTS]", [
{ action: showMainMenu, label: "Back" },
{
action: showProblematicLocalDevelopments,
label: "List of problematic developments",
},
{ action: showLocalDevelopments, label: "List of local developments" },
{ action: showAllDevelopments, label: "List of all developments" },
]);
Expand Down

0 comments on commit 88b8ceb

Please sign in to comment.