Skip to content

Commit

Permalink
Add copyright notice to multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebouget committed Jan 9, 2025
1 parent 1155c17 commit 5e6af81
Show file tree
Hide file tree
Showing 22 changed files with 159 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"electron:publish": "npm run build:prod && electron-builder build --publish=never",
"electron:mac": "npm run build:prod && electron-builder build --mac -p always",
"lint": "ng lint",
"updateElectron": "npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=http://proxypac.si.francetelecom.fr:8080/ yarn add [email protected] --force --legacy-peer-deps",
"addHeader": "ts-node scripts/add-header.js",
"updateVersions": "ncu -u --target minor"
},
"dependencies": {
Expand Down
38 changes: 38 additions & 0 deletions scripts/add-header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const fs = require('fs');
const path = require('path');

// Chemin du projet Angular
const projectDir = './src';

// Header à ajouter
const headerComment = `/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/
`;

function addHeaderToFile(filePath) {
const fileContent = fs.readFileSync(filePath, 'utf8');
if (!fileContent.startsWith('/**')) {
const newContent = headerComment + fileContent;
fs.writeFileSync(filePath, newContent, 'utf8');
console.log(`Header ajouté à : ${filePath}`);
} else {
console.log(`Header déjà présent dans : ${filePath}`);
}
}

function traverseDirectory(directory) {
fs.readdirSync(directory).forEach((file) => {
const fullPath = path.join(directory, file);
if (fs.statSync(fullPath).isDirectory()) {
traverseDirectory(fullPath);
} else if (fullPath.endsWith('.js') || fullPath.endsWith('.ts')) {
addHeaderToFile(fullPath);
}
});
}

traverseDirectory(projectDir);
6 changes: 6 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

/* eslint-disable no-console */
import {
AfterViewInit,
Expand Down
6 changes: 6 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { BrowserModule } from '@angular/platform-browser';
import {
NgModule,
Expand Down
6 changes: 6 additions & 0 deletions src/app/big-file-loading/big-file-loading.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { ChangeDetectorRef, Component } from '@angular/core';
import { FileSystemService } from '../core/services/file-system.service';
import { Subscription } from 'rxjs';
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/config.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable } from '@angular/core';

@Injectable({
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/electron.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable } from '@angular/core';

// If you import a module but never use any of the imported values other than as TypeScript types,
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/file-system.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable, NgZone } from '@angular/core';
import { ElectronService } from './electron.service';
import { TranslateService } from '@ngx-translate/core';
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/lib-version.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable } from '@angular/core';
import packageInfo from '../../../../package.json';

Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/menu.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { ElectronService } from './electron.service';
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/services/tracker.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { Injectable } from '@angular/core';
import { ElectronService } from './electron.service';
import { MatomoTracker, MatomoInitializerService } from 'ngx-matomo-client';
Expand Down
6 changes: 6 additions & 0 deletions src/environments/environment.dev.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

export const APP_CONFIG = {
production: false,
environment: 'DEV',
Expand Down
6 changes: 6 additions & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

export const APP_CONFIG = {
production: true,
environment: 'PROD',
Expand Down
6 changes: 6 additions & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

export const APP_CONFIG = {
production: false,
environment: 'LOCAL',
Expand Down
6 changes: 6 additions & 0 deletions src/environments/environment.web.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

export const APP_CONFIG = {
production: true,
environment: 'WEB-PROD',
Expand Down
6 changes: 6 additions & 0 deletions src/environments/environment.web.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

export const APP_CONFIG = {
production: false,
environment: 'WEB',
Expand Down
6 changes: 6 additions & 0 deletions src/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

Expand Down
6 changes: 6 additions & 0 deletions src/polyfills-test.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

import 'zone.js';
6 changes: 6 additions & 0 deletions src/test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/testing';
Expand Down
6 changes: 6 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* Copyright (c) 2023-2025 Orange. All rights reserved.
* This software is distributed under the BSD 3-Clause-clear License, the text of which is available
* at https://spdx.org/licenses/BSD-3-Clause-Clear.html or see the "LICENSE" file for more details.
*/

/* SystemJS module definition */
declare const nodeModule: NodeModule;
interface NodeModule {
Expand Down

0 comments on commit 5e6af81

Please sign in to comment.