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

Empty parent directories are not preserved with --outDir #2644

Closed
alexeagle opened this issue Apr 6, 2015 · 1 comment · Fixed by #2772
Closed

Empty parent directories are not preserved with --outDir #2644

alexeagle opened this issue Apr 6, 2015 · 1 comment · Fixed by #2772
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@alexeagle
Copy link
Contributor

I have a source structure in which there is a single top-level directory, and I expect the same structure to be produced in the outDir, instead it is dropped. It seems that tsc trims singleton parent directories.
That behavior is okay, but I would like to be able to explicitly say what the baseDir is, and have the output structure match the input, relative to the baseDir.

Here is a session which demonstrates the problem:

alexeagle-macbookpro2:tmp alexeagle$ mkdir -p dir1/dir2/dir3
alexeagle-macbookpro2:tmp alexeagle$ cat > dir1/dir2/dir3/test3.ts
console.log("dir3");
alexeagle-macbookpro2:tmp alexeagle$ mkdir out
alexeagle-macbookpro2:tmp alexeagle$ tsc --outDir out dir1/dir2/dir3/test3.ts
alexeagle-macbookpro2:tmp alexeagle$ ls out/
test3.js
alexeagle-macbookpro2:tmp alexeagle$ cat > dir1/dir2/test2.ts
console.log('dir2');
alexeagle-macbookpro2:tmp alexeagle$ tsc --outDir out dir1/dir2/dir3/test3.ts dir1/dir2/test2.ts
alexeagle-macbookpro2:tmp alexeagle$ ls out
dir3    test2.js

It's kind of surprising that by adding a file in dir2, the test3.js file has disappeared from the outDir.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 6, 2015

This is something we need to add. The current behaviour is that the basePath/CommonSourceRoot/ProjectRoot is computed as the longest common directory of all source files. and that is what is used to replicate the input structure under the output directory..

We have discussed this issue before in #2034 (comment) and in #287

@mhegazy mhegazy added the Bug A bug in TypeScript label Apr 6, 2015
@mhegazy mhegazy added this to the TypeScript 1.5 milestone Apr 6, 2015
@mhegazy mhegazy self-assigned this Apr 6, 2015
alexeagle added a commit to alexeagle/angular that referenced this issue Apr 6, 2015
alexeagle added a commit to alexeagle/angular that referenced this issue Apr 6, 2015
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Apr 20, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants