Skip to content

Commit

Permalink
fix: use unshift instead of push
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Dec 28, 2023
1 parent c9a7704 commit 81cc3b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/nx-gradle/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function addOrUpdatePrettierIgnore(tree: Tree) {
const prettierIgnoreOldContent =
tree.read(prettierIgnorePath, 'utf-8') || '';

gradlePrettierIgnores.push('\n\n');
gradlePrettierIgnores.unshift('\n\n');
const prettierIgnoreContent = prettierIgnoreOldContent.concat(
gradlePrettierIgnores.join(''),
);
Expand All @@ -238,7 +238,7 @@ function addOrUpdateGitattributes(tree: Tree) {

if (tree.exists(gitattributesPath)) {
const gitattributesOldContent = tree.read(gitattributesPath, 'utf-8') || '';
attributes.push('\n\n');
attributes.unshift('\n\n');

const gitattributesContent = gitattributesOldContent.concat(
attributes.join(''),
Expand Down
4 changes: 2 additions & 2 deletions packages/nx-maven/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function addOrUpdatePrettierIgnore(tree: Tree) {
if (tree.exists(prettierIgnorePath)) {
const prettierIgnoreOldContent =
tree.read(prettierIgnorePath, 'utf-8') || '';
mavenPrettierIgnores.push('\n\n');
mavenPrettierIgnores.unshift('\n\n');

const prettierIgnoreContent = prettierIgnoreOldContent.concat(
mavenPrettierIgnores.join(''),
Expand All @@ -263,7 +263,7 @@ function addOrUpdateGitattributes(tree: Tree) {

if (tree.exists(gitattributesPath)) {
const gitattributesOldContent = tree.read(gitattributesPath, 'utf-8') || '';
attributes.push('\n\n');
attributes.unshift('\n\n');

const gitattributesContent = gitattributesOldContent.concat(
attributes.join(''),
Expand Down

0 comments on commit 81cc3b5

Please sign in to comment.