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

Select asset files recursively #28

Closed
btk opened this issue Oct 6, 2017 · 7 comments
Closed

Select asset files recursively #28

btk opened this issue Oct 6, 2017 · 7 comments

Comments

@btk
Copy link
Owner

btk commented Oct 6, 2017

Currently, our logic is to list all the assets in the top level of given directory path.

We need to list and add the assets to our generated map in a recursive way;

Eg;

assets/
  - subasset/
     - subasset1.png
     - subasset2.png
  - asset1.png
  - asset2.png

Mapping this like;

{
  subasset_subasset1_png: ...,
  subasset_subasset2_png: ...,
  asset1_png: ...,
  asset2_png: ...,
}

Seems like a general solution, we should implement it this way. Also we might give user the preference to only list the current top level folder path in the future.

Is there anyone that would like to implement this? Thank you.

@btk
Copy link
Owner Author

btk commented Oct 6, 2017

Also I'm second guessing my proposition

assets/
  - subasset/
     - subasset1.png
  - subasset-asset1.png

In a situation like this, while mapping 2 file will have the same property name.

We might also think about implementing it in multiple levels of the object.


So the eg would be like;

assets/
  - subasset/
     - subasset1.png
     - subasset2.png
  - asset1.png
  - asset2.png

Mapping this like;

{
  subasset: {
     subasset1_png: ...,
     subasset2_png: ...,
  },
  asset1_png: ...,
  asset2_png: ...,
}

I'm leaving the choice to person who would like to implement. But keep it in mind implementing it like the second proposition, you might have to revisit and refactor .format() and .search().

Thank you.

@btk
Copy link
Owner Author

btk commented Oct 6, 2017

Using recursive-readdir-sync might be useful for implementing this.

https://www.npmjs.com/package/recursive-readdir-sync

@hanstf
Copy link
Contributor

hanstf commented Oct 7, 2017

can I try it ?

@btk
Copy link
Owner Author

btk commented Oct 7, 2017

@hanstf Yes sure, if you have any questions along the way you can ask it here.

@hanstf
Copy link
Contributor

hanstf commented Oct 8, 2017

I tried to implement it, you may check in my fork here

@btk
Copy link
Owner Author

btk commented Oct 8, 2017

@hanstf that looks good, can you make a pull request so I can compare it with master to analyze more?


Edit: Oh I just saw the pull request, I will check it as soon as possible.

@btk
Copy link
Owner Author

btk commented Oct 13, 2017

Handled by #30

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants