Skip to content

Commit

Permalink
fix(admin): added support for non Administrator CLI user
Browse files Browse the repository at this point in the history
In case of non-admin user instead of symlinkSync will just writeFileSync.

Close angular#905
Fix angular#886
Fix angular#370
  • Loading branch information
degiorgig authored and devCrossNet committed Jun 9, 2016
1 parent 3e57f06 commit 43089ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ The installation of 3rd party libraries are well described at our [Wiki Page](ht
This project is currently a prototype so there are many known issues. Just to mention a few:

- All blueprints/scaffolds are in TypeScript only, in the future blueprints in all dialects officially supported by Angular will be available.
- On Windows you need to run the `build` and `serve` commands with Admin permissions.
- On Windows you need to run the `build` and `serve` commands with Admin permissions, otherwise the performance is not good.
- The initial installation as well as `ng new` take too long because of lots of npm dependencies.
- Many existing ember addons are not compatible with Angular apps built via angular-cli.
- When you `ng serve` remember that the generated project has dependencies that require **Node 4 or greater**.
Expand Down
14 changes: 12 additions & 2 deletions lib/broccoli/broccoli-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
this._fileRegistry[tsFilePath].outputs.forEach(absoluteFilePath => {
const outputFilePath = absoluteFilePath.replace(this.cachePath, this.outputPath);
fse.mkdirsSync(path.dirname(outputFilePath));
fs.symlinkSync(absoluteFilePath, outputFilePath);
try {
fs.symlinkSync(absoluteFilePath, outputFilePath);
} catch (e) {
const conentStr = fs.readFileSync(absoluteFilePath);
fs.writeFileSync(outputFilePath, conentStr);
}
});
} else {
this._fileRegistry[tsFilePath].version = entry.mtime;
Expand Down Expand Up @@ -203,7 +208,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
fs.writeFileSync(absoluteFilePath, content, FS_OPTS);

fse.mkdirsSync(path.dirname(outputFilePath));
fs.symlinkSync(absoluteFilePath, outputFilePath);
try {
fs.symlinkSync(absoluteFilePath, outputFilePath);
} catch (e) {
const conentStr = fs.readFileSync(absoluteFilePath);
fs.writeFileSync(outputFilePath, conentStr);
}
}

_addNewFileEntry(entry, checkDuplicates /* = true */) {
Expand Down

0 comments on commit 43089ad

Please sign in to comment.