Skip to content

Commit 0bc3d94

Browse files
degiorgigfilipesilva
authored andcommitted
fix(admin): added support for non Administrator CLI user
In case of non-admin user instead of symlinkSync will just writeFileSync. Close #905 Fix #886 Fix #370
1 parent 9de90e1 commit 0bc3d94

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The installation of 3rd party libraries are well described at our [Wiki Page](ht
240240
This project is currently a prototype so there are many known issues. Just to mention a few:
241241

242242
- All blueprints/scaffolds are in TypeScript only, in the future blueprints in all dialects officially supported by Angular will be available.
243-
- On Windows you need to run the `build` and `serve` commands with Admin permissions.
243+
- On Windows you need to run the `build` and `serve` commands with Admin permissions, otherwise the performance is not good.
244244
- The initial installation as well as `ng new` take too long because of lots of npm dependencies.
245245
- Many existing ember addons are not compatible with Angular apps built via angular-cli.
246246
- When you `ng serve` remember that the generated project has dependencies that require **Node 4 or greater**.

lib/broccoli/broccoli-typescript.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
7878
this._fileRegistry[tsFilePath].outputs.forEach(absoluteFilePath => {
7979
const outputFilePath = absoluteFilePath.replace(this.cachePath, this.outputPath);
8080
fse.mkdirsSync(path.dirname(outputFilePath));
81-
fs.symlinkSync(absoluteFilePath, outputFilePath);
81+
try {
82+
fs.symlinkSync(absoluteFilePath, outputFilePath);
83+
} catch (e) {
84+
const conentStr = fs.readFileSync(absoluteFilePath);
85+
fs.writeFileSync(outputFilePath, conentStr);
86+
}
8287
});
8388
} else {
8489
this._fileRegistry[tsFilePath].version = entry.mtime;
@@ -203,7 +208,12 @@ class BroccoliTypeScriptCompiler extends Plugin {
203208
fs.writeFileSync(absoluteFilePath, content, FS_OPTS);
204209

205210
fse.mkdirsSync(path.dirname(outputFilePath));
206-
fs.symlinkSync(absoluteFilePath, outputFilePath);
211+
try {
212+
fs.symlinkSync(absoluteFilePath, outputFilePath);
213+
} catch (e) {
214+
const conentStr = fs.readFileSync(absoluteFilePath);
215+
fs.writeFileSync(outputFilePath, conentStr);
216+
}
207217
}
208218

209219
_addNewFileEntry(entry, checkDuplicates /* = true */) {

0 commit comments

Comments
 (0)