Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Kernel User script: joyvan -> analyticalplatform in kernel.json #64

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gary-H9
Copy link
Contributor

@Gary-H9 Gary-H9 commented Nov 14, 2024

Raised in relation to this issue.

Summary

This PR adds a script to automate the replacement of the string "jovyan" with "analyticalplatform" in any kernel.json files located under the base directory /home/jovyan/.local/share/jupyter/kernels.

Script Explanation

The script performs the following actions:

  1. Defines BASE_DIR: Specifies the base directory where Jupyter kernel files are located (/home/jovyan/.local/share/jupyter/kernels).
  2. Finds All kernel.json Files: Uses the find command to locate all kernel.json files within BASE_DIR and its subdirectories. The find command searches recursively, so it will locate any kernel.json files in all directories under BASE_DIR (e.g., /home/jovyan/.local/share/jupyter/kernels/dir1, /home/jovyan/.local/share/jupyter/kernels/dir2, etc.).
  3. Replaces String in kernel.json Files: For each kernel.json file found, the sed command replaces occurrences of "jovyan" with "analyticalplatform".

Example Directory Structure

The script will successfully modify kernel.json files in a directory structure like this:
/home/jovyan/.local/share/jupyter/kernels/

...
├── dir1/ 
│
└── kernel.json 
├── dir2/ 
│ 
└── kernel.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant