aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts10
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js90
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts20
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js30
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts18
-rw-r--r--sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js11
6 files changed, 179 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts
new file mode 100644
index 00000000..e412a64b
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.d.ts
@@ -0,0 +1,10 @@
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+import { TaskExecutor } from '../../src';
+import { RepositoryInitializerTaskFactoryOptions, RepositoryInitializerTaskOptions } from './options';
+export default function (factoryOptions?: RepositoryInitializerTaskFactoryOptions): TaskExecutor<RepositoryInitializerTaskOptions>;
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js
new file mode 100644
index 00000000..4acf4f56
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/executor.js
@@ -0,0 +1,90 @@
+"use strict";
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const core_1 = require("@angular-devkit/core");
+const child_process_1 = require("child_process");
+const path = __importStar(require("path"));
+function default_1(factoryOptions = {}) {
+ const rootDirectory = factoryOptions.rootDirectory || process.cwd();
+ return async (options = {}, context) => {
+ const authorName = options.authorName;
+ const authorEmail = options.authorEmail;
+ const execute = (args, ignoreErrorStream) => {
+ const outputStream = 'ignore';
+ const errorStream = ignoreErrorStream ? 'ignore' : process.stderr;
+ const spawnOptions = {
+ stdio: [process.stdin, outputStream, errorStream],
+ shell: true,
+ cwd: path.join(rootDirectory, options.workingDirectory || ''),
+ env: {
+ ...process.env,
+ ...(authorName ? { GIT_AUTHOR_NAME: authorName, GIT_COMMITTER_NAME: authorName } : {}),
+ ...(authorEmail
+ ? { GIT_AUTHOR_EMAIL: authorEmail, GIT_COMMITTER_EMAIL: authorEmail }
+ : {}),
+ },
+ };
+ return new Promise((resolve, reject) => {
+ (0, child_process_1.spawn)('git', args, spawnOptions).on('close', (code) => {
+ if (code === 0) {
+ resolve();
+ }
+ else {
+ reject(code);
+ }
+ });
+ });
+ };
+ const hasCommand = await execute(['--version']).then(() => true, () => false);
+ if (!hasCommand) {
+ return;
+ }
+ const insideRepo = await execute(['rev-parse', '--is-inside-work-tree'], true).then(() => true, () => false);
+ if (insideRepo) {
+ context.logger.info(core_1.tags.oneLine `
+ Directory is already under version control.
+ Skipping initialization of git.
+ `);
+ return;
+ }
+ // if git is not found or an error was thrown during the `git`
+ // init process just swallow any errors here
+ // NOTE: This will be removed once task error handling is implemented
+ try {
+ await execute(['init']);
+ await execute(['add', '.']);
+ if (options.commit) {
+ const message = options.message || 'initial commit';
+ await execute(['commit', `-m "${message}"`]);
+ }
+ context.logger.info('Successfully initialized git.');
+ }
+ catch { }
+ };
+}
+exports.default = default_1;
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts
new file mode 100644
index 00000000..08fd4040
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.d.ts
@@ -0,0 +1,20 @@
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+import { TaskConfiguration, TaskConfigurationGenerator } from '../../src';
+import { RepositoryInitializerTaskOptions } from './options';
+export interface CommitOptions {
+ message?: string;
+ name?: string;
+ email?: string;
+}
+export declare class RepositoryInitializerTask implements TaskConfigurationGenerator<RepositoryInitializerTaskOptions> {
+ workingDirectory?: string | undefined;
+ commitOptions?: CommitOptions | undefined;
+ constructor(workingDirectory?: string | undefined, commitOptions?: CommitOptions | undefined);
+ toConfiguration(): TaskConfiguration<RepositoryInitializerTaskOptions>;
+}
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js
new file mode 100644
index 00000000..8809b29f
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/init-task.js
@@ -0,0 +1,30 @@
+"use strict";
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RepositoryInitializerTask = void 0;
+const options_1 = require("./options");
+class RepositoryInitializerTask {
+ constructor(workingDirectory, commitOptions) {
+ this.workingDirectory = workingDirectory;
+ this.commitOptions = commitOptions;
+ }
+ toConfiguration() {
+ return {
+ name: options_1.RepositoryInitializerName,
+ options: {
+ commit: !!this.commitOptions,
+ workingDirectory: this.workingDirectory,
+ authorName: this.commitOptions && this.commitOptions.name,
+ authorEmail: this.commitOptions && this.commitOptions.email,
+ message: this.commitOptions && this.commitOptions.message,
+ },
+ };
+ }
+}
+exports.RepositoryInitializerTask = RepositoryInitializerTask;
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts
new file mode 100644
index 00000000..93816617
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.d.ts
@@ -0,0 +1,18 @@
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+export declare const RepositoryInitializerName = "repo-init";
+export interface RepositoryInitializerTaskFactoryOptions {
+ rootDirectory?: string;
+}
+export interface RepositoryInitializerTaskOptions {
+ workingDirectory?: string;
+ commit?: boolean;
+ message?: string;
+ authorName?: string;
+ authorEmail?: string;
+}
diff --git a/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js
new file mode 100644
index 00000000..2185b470
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/@angular-devkit/schematics/tasks/repo-init/options.js
@@ -0,0 +1,11 @@
+"use strict";
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RepositoryInitializerName = void 0;
+exports.RepositoryInitializerName = 'repo-init';