Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions angular/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../core

Expand Down
3 changes: 3 additions & 0 deletions angular/test/base/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../../../../core

Expand Down
3 changes: 3 additions & 0 deletions packages/react-router/test/base/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../../../../../core

Expand Down
3 changes: 3 additions & 0 deletions packages/react/test/base/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../../../../../core

Expand Down
3 changes: 3 additions & 0 deletions packages/vue-router/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../../core

Expand Down
3 changes: 3 additions & 0 deletions packages/vue/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work on Windows?

Copy link
Contributor Author

@sean-perkins sean-perkins Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately no. I'm not familiar with Windows bash commands, do you know if something like this would work?

if [[ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]]; then
  del /s *.tgz
else
  rm -rf *.tgz
fi

Edit: Maybe something like this? (confirmed the linux/unix command works):

#!/bin/bash

set -e

# Delete old packages
if [[ "$(uname)" == "Darwin" || "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
    # Linux/Unix
    find . -type f -name "*.tgz" -delete
elif [[ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]]; then
    # Windows/Cygwin
    del /s *.tgz
fi

# Pack @ionic/core
npm pack ../../core

# Pack @ionic/vue-router
npm pack ../vue-router

# Install Dependencies
npm install *.tgz --no-save

# Cleanup
if [[ "$(uname)" == "Darwin" || "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
    # Linux/Unix
    find . -type f -name "*.tgz" -delete
elif [[ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ]]; then
    # Windows/Cygwin
    del /s *.tgz
fi

Copy link
Contributor

@liamdebeasi liamdebeasi Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used rimraf before and it's worked pretty well. Maybe we could do that and have rimraf as a project-level dependency?

edit: Actually hmm that may not be a good idea on CI since we'll need to cache node modules for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf works just fine 👀 I just have to do it in a bash terminal (which is already the case with the rest of the script).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! In that case, let's just stick with rm.


# Pack @ionic/core
npm pack ../../core

Expand Down
3 changes: 3 additions & 0 deletions packages/vue/test/base/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

# Delete old packages
rm -rf *.tgz

# Pack @ionic/core
npm pack ../../../../../core

Expand Down