Skip to content

Commit

Permalink
feat(scripts): pwsh script for manipulating the yarn cache (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantumlyy authored Jul 24, 2020
1 parent 077c735 commit 36b956e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,ts}]
[*.{js,ts,mjs}]
indent_size = 4
indent_style = tab
block_comment_start = /*
Expand All @@ -20,3 +20,8 @@ indent_style = space
[*.{md,rmd,mkd,mkdn,mdwn,mdown,markdown,litcoffee}]
tab_width = 4
trim_trailing_whitespace = false

[*.{ps1}]
max_line_length = 115
indent_size = 4
indent_style = space
26 changes: 26 additions & 0 deletions scripts/dependencycache.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Function Step-Main {
Param (
[string]$Command = "default",
[string]$Manager = "yarn"
)

Process {
switch ( $Command ) {
clear {
Remove-Item -Recurse -Force -ErrorAction Ignore dist
Remove-Item -Recurse -Force -ErrorAction Ignore node_modules
switch ($Manager) {
yarn {
Remove-Item -Recurse -Force -ErrorAction Ignore $(yarn cache dir)
}
npm {
npm cache rm --force
}
}
}
default { Write-Host "Unrecognized command, please try again" -ForegroundColor Red }
}
}
}

Step-Main @args

0 comments on commit 36b956e

Please sign in to comment.