Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Only adding folders to stack with a compose file. #299

Merged
merged 6 commits into from
Dec 15, 2023

Conversation

Ozy-Viking
Copy link
Contributor

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/dockge/blob/master/CONTRIBUTING.md

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Fixes #183

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (Maybe)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Before

image

After

image

@Ozy-Viking
Copy link
Contributor Author

It checks if the folder in the stacks has any of the following files "compose.yaml", "compose.yml", "docker-compose.yml", "docker-compose.yaml" .

* @param {string} filename - The name of the directory to check for the compose file.
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether any compose file exists.
*/
static async composeFileExists(stacksDir : string, filename : string) : Promise<boolean> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it is a bit over used await and promise here. I try to rewrite it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No kidding, that is definitely a weak point for me hahaha

@louislam louislam added this to the 1.4.0 milestone Dec 15, 2023
@louislam
Copy link
Owner

Actually I was thinking using something like .gitignore to exclude them, because file system operations will be fewer.

I think it is ok at this moment.

@louislam louislam merged commit 94ca8a1 into louislam:master Dec 15, 2023
6 checks passed
@MrNavaStar
Copy link

Actually I was thinking using something like .gitignore to exclude them, because file system operations will be fewer.

I think it would be a good idea to also rely on the gitignore, but the gitignore often doesn't hide some main folders (like the .git folder) so if you are going this approach you would probably want something more custom.

@louislam louislam removed this from the 1.4.0 milestone Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Folders without compose config visible in UI
3 participants