Typescript: Preserve execute permissions

Created on 5 Jun 2017  路  3Comments  路  Source: microsoft/TypeScript

Feature request. Could the 'execute' permission be preserved the the generated output?

Current situation:

ls -l src
-rwxr-xr-x 1 user staff 656 Jun  4 19:42 main.ts

ls -l build
-rw-r--r-- 1 user staff 788 Jun  4 19:56 main.js

It would be nice if build/main.js also had the x permissions so it can be executed directly.

Out of Scope Suggestion

All 3 comments

Managing permissions for files isn't in the scope of this project. See #14726 for a sort of "dual" request.

As a workaround in my case I added the executable script file to a folder outside the build dir (let's say bin), and keep the contents to just a single require call to the one in the build dir.

./bin/foo.js:

#! /usr/bin/env node
require('../build/foo.js');

This file in bin stays the same, so I added the executable flag there.

The response of "managing permissions" isn't really what this is about. It's more about preserving the runtime characteristics.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seanzer picture seanzer  路  3Comments

DanielRosenwasser picture DanielRosenwasser  路  3Comments

weswigham picture weswigham  路  3Comments

jbondc picture jbondc  路  3Comments

bgrieder picture bgrieder  路  3Comments