Skip to content

Generate icons with custom path#1

Open
SamBarFu wants to merge 1 commit intoJamesDelfini:mainfrom
SamBarFu:sb/generate-icons-with-custom-path
Open

Generate icons with custom path#1
SamBarFu wants to merge 1 commit intoJamesDelfini:mainfrom
SamBarFu:sb/generate-icons-with-custom-path

Conversation

@SamBarFu
Copy link

Description

A functionality is added so that through the command line the path where the generated icons will be saved can be specified.

Problem or Related Task

While working on my project, which required the icons to be executed in a specific path, the opportunity arose for the icon save path to be managed from the command line.

Changes Made

The scope of the variable iconsPath is changed to let, as it is intended to be updated in case a new path comes from the command line.

Within the generateIcons function, a validation is added to determine if there is a string in the argIconNames array that starts with --path=. If this condition is true, the index where the match of the string starting with --path= is found is obtained. Then, the value of the path is obtained by substring starting from the length of --path=. Finally, the path is obtained, and the value of iconsPath is reassigned.

If it cannot be identified that a string starting with --path= exists in the array, the value of iconsPath remains with the default value.

Tests Performed

(Describe the tests you have conducted to ensure your changes work as expected)

Testing Steps

(Provide step-by-step instructions for the reviewer to test your changes)

  1. Run the command 'node generate-icons.js cart3 --path=./test'.
  2. Check that the icons are generated in the 'test' folder.

Additional Notes

(Any other relevant information you want to add)

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.

1 participant