Skip to content

Commit 396e662

Browse files
committed
feature: adds public folder
1 parent fb3337b commit 396e662

File tree

7 files changed

+206
-211
lines changed

7 files changed

+206
-211
lines changed

addon/ng2/blueprints/ng2/files/public/.gitignore

Whitespace-only changes.

addon/ng2/blueprints/ng2/files/public/.placeholder

Whitespace-only changes.

addon/ng2/commands/version.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Command from 'ember-cli/lib/models/command';
22
import * as path from 'path';
3-
3+
import * as child_process from 'child_process';
44

55
const VersionCommand = Command.extend({
66
name: 'version',
@@ -21,7 +21,19 @@ const VersionCommand = Command.extend({
2121

2222
var alwaysPrint = ['node', 'os'];
2323

24-
this.printVersion('angular-cli', pkg.version);
24+
var ngCliVersion = pkg.version;
25+
if (!__dirname.match(/node_modules/)) {
26+
var gitBranch = '??';
27+
try {
28+
var gitRefName = '' + child_process.execSync('git symbolic-ref HEAD', {cwd: __dirname});
29+
gitBranch = path.basename(gitRefName.replace('\n', ''));
30+
} catch (e) {
31+
}
32+
33+
ngCliVersion = `local (v${pkg.version}, branch: ${gitBranch})`;
34+
}
35+
36+
this.printVersion('angular-cli', ngCliVersion);
2537

2638
for (var module in versions) {
2739
if (options.verbose || alwaysPrint.indexOf(module) > -1) {

lib/broccoli/angular2-app.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var path = require('path');
22
var configReplace = require('./broccoli-config-replace');
3-
var compileWithTypescript = require('./broccoli-typescript').default;
3+
var compileWithTypescript = require('./broccoli-typescript');
44
var SwManifest = require('./service-worker-manifest').default;
55
var fs = require('fs');
66
var Funnel = require('broccoli-funnel');
@@ -71,11 +71,6 @@ Angular2App.prototype.toTree = function () {
7171
exclude: ['*.d.ts', 'tsconfig.json']
7272
});
7373

74-
var tsSrcTree = new Funnel(sourceDir, {
75-
include: ['**/*.ts'],
76-
allowEmpty: true
77-
});
78-
7974
var jsTree = new Funnel(sourceDir, {
8075
include: ['**/*.js'],
8176
allowEmpty: true
@@ -92,11 +87,15 @@ Angular2App.prototype.toTree = function () {
9287
destDir: 'vendor'
9388
});
9489

90+
var publicDirTree = new Funnel('public', {
91+
allowEmpty: true
92+
});
93+
9594
var merged = mergeTrees([
9695
assetTree,
97-
tsSrcTree,
9896
tsTree,
9997
jsTree,
98+
publicDirTree,
10099
this.index(),
101100
vendorNpmTree
102101
], { overwrite: true });

0 commit comments

Comments
 (0)