-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrename_organizations.sh
executable file
·45 lines (38 loc) · 1.48 KB
/
rename_organizations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# ########################################################################
#
# Ricgraph - Research in context graph
#
# ########################################################################
#
# MIT License, Copyright (c) 2025 Rik D.T. Janssen
#
# ########################################################################
#
# This script renames organizations, using a file containing
# the (sub-)organizations to rename.
# It is a wrapper for the python script rename_orgs.py.
# For command line options, read the comments in file
# ../library/get_cmdline_args.sh.
#
# Original version Rik D.T. Janssen, April 2025.
#
# ########################################################################
rename_organizations () {
rename_orgs_file=orgs_to_rename_$organization.csv
echo "Batch renaming organizations for organization '$organization', using"
echo "file '$rename_orgs_file' that tells what to rename."
PYTHONPATH=$python_path $python_cmd ./rename_orgs.py --filename "$rename_orgs_file" --are_you_sure yes
exit_code=$?
if [ "$exit_code" = "0" ] ; then
echo "Done with renaming organizations for organization $organization."
else
echo "--> $0: error while renaming organizations for organization $organization, status: '$exit_code'."
exit $exit_code
fi
}
echo "This script renames organizations based on a file."
# The following script returns $python_cmd, $python_path,
# $organization, and $empty_ricgraph.
source ../library/get_cmdline_args.sh
rename_organizations