Commit eb7f4615 authored by Blais, Chris's avatar Blais, Chris
Browse files

adding nb clean script

parent 5d084bbb
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
# Define the root directory of your repository
$repoPath = $PSScriptRoot

# Find all .ipynb files within the repository and its subdirectories
$notebookFiles = Get-ChildItem -Path $repoPath -Filter "*.ipynb" -Recurse

Write-Host "The script is located in: $repoPath"

foreach ($notebookFile in $notebookFiles) {
    Write-Host "Cleaning $($notebookFile.FullName)..."
    # Execute nb-clean on the current notebook.
    # The '-m' flag preserves cell metadata, adjust as needed.
    # For other options like -e (remove empty cells) or -o (preserve outputs), refer to nb-clean documentation.
    nb-clean clean "$($notebookFile.FullName)"
    Write-Host "Cleaned $($notebookFile.FullName)."
}