Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marcus-lodspeakr
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uib-ub
Spesialsamlingene
marcus-lodspeakr
Commits
a270b7f3
Commit
a270b7f3
authored
13 years ago
by
alangrafu
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/alangrafu/lodspeakr
parents
dbdd6475
4aeb23ca
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/ldspk.sh
+19
-22
19 additions, 22 deletions
utils/ldspk.sh
with
19 additions
and
22 deletions
utils/ldspk.sh
+
19
−
22
View file @
a270b7f3
#!/bin/bash
#!/bin/bash
#
# https://github.com/alangrafu/lodspeakr/blob/master/utils/ldspk.sh
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
USAGE
=
"Usage:
$0
create|delete uri|class|service foo [html|rdf|ttl|nt|json]"
USAGE
=
"Usage:
$0
create|delete uri|class|service foo [html|rdf|ttl|nt|json]"
formats
=(
html rdf ttl nt json all
)
if
[[
$#
-eq
0
||
"
$1
"
==
"--help"
]]
;
then
echo
$USAGE
exit
1
fi
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
operations
=(
create delete
)
operations
=(
create delete
)
modules
=(
class service uri
)
modules
=(
class service uri
)
formats
=(
html rdf ttl nt json all
)
currentOperation
=
currentOperation
=
currentFormat
=
currentModule
=
currentModule
=
currentFormat
=
if
[[
${
operations
[@]
}
=
~
$1
]]
if
[[
${
operations
[@]
}
=
~
$1
]]
;
then
then
currentOperation
=
$1
currentOperation
=
$1
else
else
echo
"Operation
\"
$1
\"
not valid"
echo
"Operation
\"
$1
\"
not valid"
...
@@ -19,8 +25,7 @@ else
...
@@ -19,8 +25,7 @@ else
exit
1
exit
1
fi
fi
if
[[
${
modules
[@]
}
=
~
$2
]]
if
[[
${
modules
[@]
}
=
~
$2
]]
;
then
then
currentModule
=
$2
currentModule
=
$2
else
else
echo
"Module
\"
$2
\"
not valid"
echo
"Module
\"
$2
\"
not valid"
...
@@ -28,31 +33,23 @@ else
...
@@ -28,31 +33,23 @@ else
exit
1
exit
1
fi
fi
if
[[
${
formats
[@]
}
=
~
$4
]]
currentUnit
=
$3
then
if
[[
${
formats
[@]
}
=
~
$4
]]
;
then
currentFormat
=
$4
currentFormat
=
$4
else
else
if
[
-z
"
$4
"
]
if
[
-z
"
$4
"
]
;
then
then
currentFormat
=
"all"
currentFormat
=
"all"
else
else
echo
"Format
\"
$4
\"
not valid"
echo
"Format
\"
$4
\"
not valid"
echo
$USAGE
echo
$USAGE
exit
1
exit
1
fi
fi
fi
fi
if
[[
$currentOperation
==
"create"
]]
;
then
currentUnit
=
$3
if
[[
$currentOperation
==
"create"
]]
then
$DIR
/modules/create-
$currentModule
.sh
"
$currentUnit
"
"
$currentFormat
"
$DIR
/modules/create-
$currentModule
.sh
"
$currentUnit
"
"
$currentFormat
"
fi
fi
if
[[
$currentOperation
==
"delete"
]]
if
[[
$currentOperation
==
"delete"
]]
;
then
then
$DIR
/modules/delete-
$currentModule
.sh
"
$currentUnit
"
"
$currentFormat
"
$DIR
/modules/delete-
$currentModule
.sh
"
$currentUnit
"
"
$currentFormat
"
fi
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment