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

Different folder structure results in Windows vs Linux: missing src folder #142

Open
andria-dev opened this issue May 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@andria-dev
Copy link

andria-dev commented May 22, 2020

When running the command yarn destiny ./src the results are different between Windows and Linux. Linux behaves as expected and organizes the files and directories inside of the src directory, whereas, Windows places the files at the root of the project.

My project file structure:

.
├── package.json
├── src
│   ├── App.css
│   ├── App.jsx
│   ├── index.html
│   ├── logo.svg
│   ├── main.jsx
│   └── styles.css
├── vite.config.js
└── yarn.lock

Linux result (works as expected):

INFO: Generating tree for: ./src
src
├──main
│  ├──App
│  │  ├──App.css
│  │  └──logo.svg
│  ├──App.jsx
│  └──styles.css
└──main.jsx

Windows result (very much not expected):

INFO: Generating tree for: ./src

├──main.jsx
├──main\App.jsx
├──main\App\App.css
├──main\App\logo.svg
└──main\styles.css

I think it for some reason just replaced src with nothing because the file structure is correct but it's simply not in the right place, however, it also displays weird as I wouldn't have expected the output of a tree to be flat.

Left: Ubuntu Subsystem - Bash
Right: Windows 10 - Powershell
Screenshots

@AnatoleLucet AnatoleLucet added the bug Something isn't working label May 22, 2020
@AnatoleLucet
Copy link
Collaborator

AnatoleLucet commented May 22, 2020

Destiny is moving every file out of src for the same reason as #135.

It seems like there's also an issue with the way that Destiny print the tree. I've tried to run destiny src -w using the build from #140 on a Vite React template and it correctly prettify the file structure, but the printed tree is the same as on your screenshot (except all the files were in the src folder).

@andria-dev
Copy link
Author

@AnatoleLucet Yeah I just tried out that PR too (had to fork it to change npm build script to work when doing yarn add with a GitHub repo) and it fixed the src thing but yeah, is the tree generating thing just not recognizing the \ as a valid separator or something?

@AnatoleLucet
Copy link
Collaborator

AnatoleLucet commented May 22, 2020

is the tree generating thing just not recognizing the \ as a valid separator or something?

Probably only the printTree function which only print the generated tree. But yes, this might be it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants