Skip to content

Commit a33e972

Browse files
committed
update tool installation to not reinstall
1 parent 865c57e commit a33e972

2 files changed

Lines changed: 58 additions & 25 deletions

File tree

README.md

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,73 @@
1-
The Tools branch of OPE contains the main ope tool along with its friends.
1+
# OPE Tool
22

3-
Here is some of my current thinking
3+
This tool is designed to facilitate the management of projects within the Open Publishing Environment (OPE). It includes a variety of functions for handling repositories, books, containers, and course creation.
44

5-
# OPE commands
5+
## Installation
66

7-
## Project Commands
7+
1. Clone this repository to your local machine.
8+
2. Ensure you have Git installed, as it is required for several functions.
9+
3. **Command**: In the directory, run `./install.sh`
810

9-
### `ope project <name>`
11+
## Usage
1012

11-
### `ope book new <name>`
13+
Each function in the script is intended for specific tasks. Below are the usages and descriptions for each function.
1214

13-
### `ope container new <name>`
15+
### General
1416

15-
## Book Commands
17+
- **Usage**: Run the tool with a specific command and relevant arguments.
18+
- **Command**: `ope <function> [arguments]`
1619

17-
### `ope build`
20+
### new_project
1821

19-
### `ope publish`
22+
- **Description**: Creates a new OPE project from templates.
23+
- **Usage**: `ope new_project <project_name> [repo_url]`
24+
- **Arguments**:
25+
- `project_name`: Name of the new project.
26+
- `repo_url` (optional): URL of the Git repository to associate with the project.
2027

21-
### `ope print`
28+
### new_book
2229

23-
### `ope test`
30+
- **Description**: Creates a new book within the project.
31+
- **Usage**: `ope new_book <book_name>`
32+
- **Arguments**:
33+
- `book_name`: Name of the new book.
2434

25-
## Container
35+
### new_container
2636

27-
### `ope run [user|root]`
37+
- **Description**: Adds source for building a new container for the project.
38+
- **Usage**: `ope new_container <container_name>`
39+
- **Arguments**:
40+
- `container_name`: Name of the new container.
2841

29-
### `ope build`
42+
### new_course
3043

31-
### `ope publish`
44+
- **Description**: Creates a new course with a standard set of books and a container.
45+
- **Usage**: `ope new_course <course_name> [repo_url]`
46+
- **Arguments**:
47+
- `course_name`: Name of the new course.
48+
- `repo_url` (optional): URL of the Git repository for the course.
3249

50+
### update
3351

34-
# USER GUIDE Draft
52+
- **Description**: Updates and rebases changes from the OPE framework.
53+
- **Usage**: `ope update`
54+
- No arguments required.
3555

36-
## OPE USER GUIDE
56+
### Helper Functions
3757

38-
A collection of OPE books and associated container images are organized into a project.
58+
- **`repo_add`**: Adds a repository to a project.
59+
- **`findprojectdir`**: Finds the project directory.
60+
- **`projectdir`**: Outputs the project directory.
61+
- **`new_part`**: Creates a new part in a book or course.
62+
- **`print_func_page`**: Prints the help page for functions.
63+
- **`Usage`**: Prints general usage information.
3964

40-
## Creating a new OPE project
65+
### Logging and Configuration
4166

42-
We will use the project `ucsls` as a running example.
67+
- The script includes logging functionality. Check `/tmp/ope.<process_id>.log` for logs.
68+
- Color configuration is included for better readability of output.
4369

44-
1. We recommend that you create a new email address that will act as the central admin address for your project. Eg. ucsls.organization@gmail.com. You can then use this as the admin and identity for all online resources of your project.
4570

46-
2. Assuming that you are using github or gitlab we recommend you create a new organization for your project. If you will be publishing containers as part of your project we also recommend that you create an docker image registery organization.
71+
## License
4772

73+
This project is licensed under the MIT License. See the `LICENSE` file for details.

install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
2+
23
current_dr=$(pwd)/bin
3-
echo "run the following command to add the ope to your path"
4-
echo "export PATH=$current_dr:\$PATH"
54

5+
#if path was not already added, add path
6+
if ! grep -q -s "export PATH=$current_dr:\$PATH" ~/.bashrc; then
7+
echo "export PATH=$current_dr:\$PATH" >> ~/.bashrc #add it to path
8+
source ~/.bashrc #rerun bashrc to reset shell
9+
fi
10+
11+
#tell user ope tool has been installed
12+
echo "ope has been added to the path successfully"

0 commit comments

Comments
 (0)