-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Allow customizable permissions on emitted files #16667
Comments
This guy suggests using a Language Service Plugin to accomplish this https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin is that a good idea? https://stackoverflow.com/questions/44612118/typescripts-transpiles-files-which-are-non-executable |
I don't really see what a language service plugin has to do with any of this; however, I do agree that file permissions are something we want to get involved with[1]. I'd be willing to hear from others on the team about this though. [1] Edit: I don't recall what the original intent of this comment was, but I don't actually think this now. What I am still more concerned with is that permissions on directories seems to be broken for certain cases. |
By the way, if you don't have permissions on output files, I wonder whether that has to do with TypeScript being installed globally with root (e.g. |
@DanielRosenwasser in my case, this doesn't have anything to do with sudo. Expected: |
So I get this error with git when running a commit
Here is the tsconfig.json file I have: {
"compilerOptions": {
"declaration": false,
"outDir": "./@target",
"baseUrl": ".",
"paths": {
},
"types": [
"node",
"async",
"lodash"
],
"target": "es5",
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"allowUnreachableCode": true,
"lib": [
"es2015",
"es2016",
"es2017"
]
},
"include": [
"./**/*.ts"
],
"exclude": [
"@target",
"test",
"node_modules"
]
} so I am writing all transpiled files to an adjacent directory called @target, and that directory gets written with very restrictive permissions. |
This is possibly a broader approach to #16257. |
yeah idk about this...do you happen to know if the emitted files have the same exact permissions as the source files? I am not sure I understand what determines the permissions on the target/emitted files. |
The compiler does not do anything with permissions neither reading them from input nor changing them on the output. |
Right so I am confused, what permissions are used then by default when files get written by |
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Expected behavior:
I would expect TypeScript / tsc to output .js and .d.ts files that were readable + executable, but not writable by default. Furthermore, I would expect there to be options in tsconfig.json files, to allow end-users to choose which permissions .js and .d.ts files have.
Actual behavior:
TMK, by default tsc writes files that do not have the correct permissions. If tsc creates a directory, sometimes that I do not have permissions to read/write/execute files in that dir, which is very strange.
The text was updated successfully, but these errors were encountered: