Update script to generate spec per branch
[oom/utils.git] / external-schema-repo-generator / generator / clean.sh
1 #!/bin/sh
2
3 # ============LICENSE_START=======================================================
4 # OOM
5 # ================================================================================
6 # Copyright (C) 2021 Nokia. All rights reserved.
7 # ================================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18
19 . ./utils.sh
20
21 # Arguments renaming
22 arguments_number=$#
23 generation_directory=$1
24
25 remove_generated_directory() {
26   check_arguments $arguments_number $EXPECTED_1_ARG
27   echo "Removing generated directory: $1"
28   rm -rf $1
29 }
30
31 main() {
32   check_arguments $arguments_number $EXPECTED_1_ARG
33   directory_to_remove="./$generation_directory/"
34   if [ -d "$directory_to_remove" ]
35   then
36       remove_generated_directory $directory_to_remove
37   else
38       echo "Nothing to clean. No directory: $directory_to_remove"
39   fi
40 }
41
42 main