Skip to content

Commit

Permalink
fix(infra): resolve issues of Clean files across all projects #9297 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi authored Nov 20, 2024
1 parent 1ed547a commit 906e664
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
14 changes: 7 additions & 7 deletions src/BlazorUI/Clean.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash

# This batch script is designed for comprehensive cleaning of your project by deleting unnecessary files.
# It's crucial to close any Integrated Development Environment (IDE), such as vs code, etc., before executing this script to prevent any conflicts or loss of unsaved data.
# Please note that the commands included in this script are specifically tailored for the Linux/macOS
# This batch script cleans your project by deleting unnecessary files.
# It is important to close any IDEs, such as vs for mac, before running this script to prevent conflicts or data loss.
# The commands in this script are specifically designed for macOS/Linux.

# Runs dotnet clean for each csproj file
# Runs the dotnet clean command for each .csproj file.
for csproj in $(find . -name '*.csproj'); do
dotnet clean $csproj
done

# Delete specified directories
# Deletes specified directories
for dir in $(find . -type d \( -name "bin" -o -name "obj" -o -name "node_modules" -o -name "Packages" -o -name ".vs" -o -name "TestResults" -o -name "AppPackages" -o -name ".meteor" \)); do
rm -rf $dir
done

# Delete specified files
# Deletes specified files
for file in $(find . -type f \( -name "*.csproj.user" -o -name "Resources.designer.cs" -o -name "*.css" -o -name "*.min.css" -o -name "*.js" -o -name "*.min.js" -o -name "*.map" \)); do
rm -f $file
done

# Delete empty directories
# Deletes empty directories.
find . -type d -empty -delete
18 changes: 9 additions & 9 deletions src/Clean.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash

# This batch script is designed for comprehensive cleaning of your project by deleting unnecessary files.
# It's crucial to close any Integrated Development Environment (IDE), such as vs code, etc., before executing this script to prevent any conflicts or loss of unsaved data.
# Please note that the commands included in this script are specifically tailored for the Linux/macOS
# This batch script cleans your project by deleting unnecessary files.
# It is important to close any IDEs, such as vs for mac, before running this script to prevent conflicts or data loss.
# The commands in this script are specifically designed for macOS/Linux.

# Runs dotnet clean for each csproj file
# Runs the dotnet clean command for each .csproj file.
for csproj in $(find . -name '*.csproj'); do
dotnet clean $csproj
done

# Delete specified directories
for dir in $(find . -type d \( -name "bin" -o -name "obj" -o -name "node_modules" -o -name "Packages" -o -name ".vs" -o -name "TestResults" -o -name "AppPackages" -o -name ".meteor" -o -name "App_Data" \)); do
# Deletes specified directories
for dir in $(find . -type d \( -name "bin" -o -name "obj" -o -name "node_modules" -o -name "Packages" -o -name ".vs" -o -name "TestResults" -o -name "AppPackages" -o -name ".meteor" \)); do
rm -rf $dir
done

# Delete specified files
for file in $(find . -type f \( -name "*.csproj.user" -o -name "Resources.designer.cs" -o -name "*.css" -o -name "*.min.css" -o -name "*.js" -o -name "*.min.js" -o -name "*.map" -o -name "*.pubxml*" \)); do
# Deletes specified files
for file in $(find . -type f \( -name "*.csproj.user" -o -name "Resources.designer.cs" -o -name "*.css" -o -name "*.min.css" -o -name "*.js" -o -name "*.min.js" -o -name "*.map" \)); do
rm -f $file
done

# Delete empty directories
# Deletes empty directories.
find . -type d -empty -delete
14 changes: 7 additions & 7 deletions src/Templates/BlazorEmpty/Bit.BlazorEmpty/Clean.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash

# This batch script is designed for comprehensive cleaning of your project by deleting unnecessary files.
# It's crucial to close any Integrated Development Environment (IDE), such as vs code, etc., before executing this script to prevent any conflicts or loss of unsaved data.
# Please note that the commands included in this script are specifically tailored for the Linux/macOS
# This batch script cleans your project by deleting unnecessary files.
# It is important to close any IDEs, such as vs for mac, before running this script to prevent conflicts or data loss.
# The commands in this script are specifically designed for macOS/Linux.

# Runs dotnet clean for each csproj file
# Runs the dotnet clean command for each .csproj file.
for csproj in $(find . -name '*.csproj'); do
dotnet clean $csproj
done

# Delete specified directories
# Deletes specified directories
for dir in $(find . -type d \( -name "bin" -o -name "obj" -o -name "node_modules" -o -name "Packages" -o -name ".vs" -o -name "TestResults" -o -name "AppPackages" -o -name ".meteor" \)); do
rm -rf $dir
done

# Delete specified files
# Deletes specified files
for file in $(find . -type f \( -name "*.csproj.user" -o -name "Resources.designer.cs" -o -name "*.css" -o -name "*.min.css" -o -name "*.js" -o -name "*.min.js" -o -name "*.map" \)); do
rm -f $file
done

# Delete empty directories
# Deletes empty directories.
find . -type d -empty -delete
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@
"modifiers": [
{
"copyOnly": [
"global.json",
"**/HomePage.razor",
"**/*.svg",
"**/*.png"
"**/*.png",
"**/*.sh"
],
"exclude": [
".vs/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<br />
<br />
In addition to the <a href="https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options" target="_blank">.editorconfig</a> and <a href="https://www.w3schools.com/git/git_ignore.asp?remote=github" target="_blank">.gitignore</a> files,
which have clear purposes, there are two additional files: Clean.bat and Clean.sh. These scripts are designed to remove all auto-generated files from your project.
To understand what are these extra files, please refer to the comments within these scripts.
which have clear purposes, there are two additional files: Clean.bat (Windows) and Clean.sh (macOS/Linux). These scripts are designed to remove all auto-generated files from your project.
To understand what are these extra files, please refer to the comments within these scripts. In short, if you face a tough build issue, close your IDE and run the `Clean.bat` or `Clean.sh` file.
<br />
<br />
There is also a file named <a href="https://learn.microsoft.com/en-us/dotnet/core/tools/global-json" target="_blank">global.json</a>, which mitigates potential issues arising from the use of different .NET SDK versions by team members.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
By clicking on <b>Open a Remote Window</b> and selecting <b>Reopen in Container</b> from the dropdown, you can run the project in Docker in the background.
This approach allows Visual Studio Code to operate within Docker, along with all its extensions and SDKs, leading to a much faster development experience.
<br />
<br />
If you're developing on Windows, it is recommended to run <b><i>bash ./Clean.sh</i></b> inside container the first time you open the project.
<br />
<div class="image-container">
<img class="image" src="images/templates/vs-code-docker.webp" />
</div>
Expand Down

0 comments on commit 906e664

Please sign in to comment.