Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cp-dsl-replication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
oceandsl
cp-dsl-replication
Commits
070e6fa5
Commit
070e6fa5
authored
2 years ago
by
Kali
Browse files
Options
Downloads
Patches
Plain Diff
add a script to install the lsp
parent
8769584b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VimSetupScript.py
+51
-0
51 additions, 0 deletions
VimSetupScript.py
with
51 additions
and
0 deletions
VimSetupScript.py
0 → 100644
+
51
−
0
View file @
070e6fa5
import
os
import
getpass
from
os
import
path
from
pathlib
import
Path
gitRepo
=
"
https://git.se.informatik.uni-kiel.de/oceandsl/cp-dsl-replication
"
nameOfRelease
=
"
org.oceandsl.configuration.ide-1.3.0-SNAPSHOT-ls.jar
"
pathToJar
=
"
/home/
"
+
getpass
.
getuser
()
+
"
/bin/
"
+
nameOfRelease
os
.
system
(
"
sudo apt install vim
"
)
Path
(
path
.
expanduser
(
"
~/temp
"
)).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
#print(path.expanduser("~/bin"))
Path
(
path
.
expanduser
(
"
~/bin
"
)).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
os
.
system
(
"
wget -O
"
+
"
~/bin/
"
+
nameOfRelease
+
"
"
+
gitRepo
+
"
/-/raw/master/
"
+
nameOfRelease
)
os
.
system
(
"
wget -O ~/temp/example.vimrc
"
+
gitRepo
+
"
/-/raw/master/example.vimrc
"
)
#Wenn .vimrc schon existiert müssen wir entweder mergen oder der entsprechende Code ist auch schon vorhanden dann müssen wir nichts tun
if
(
os
.
path
.
exists
(
path
.
expanduser
(
"
~/.vimrc
"
))):
newData
=
Path
(
path
.
expanduser
(
"
~/temp/example.vimrc
"
)).
read_text
().
replace
(
nameOfRelease
,
pathToJar
)
oldData
=
Path
(
path
.
expanduser
(
"
~/.vimrc
"
)).
read_text
()
if
(
newData
not
in
oldData
):
os
.
system
(
"
sudo chown
"
+
getpass
.
getuser
()
+
"
~/.vimrc
"
)
Path
(
path
.
expanduser
(
"
~/.vimrc
"
)).
write_text
(
oldData
+
newData
)
else
:
os
.
system
(
"
mv ~/temp/example.vimrc ~/.vimrc
"
)
os
.
system
(
"
sudo chown
"
+
getpass
.
getuser
()
+
"
~/.vimrc
"
)
data
=
Path
(
path
.
expanduser
(
"
~/.vimrc
"
)).
read_text
().
replace
(
nameOfRelease
,
pathToJar
)
Path
(
path
.
expanduser
(
"
~/.vimrc
"
)).
write_text
(
data
)
Path
(
path
.
expanduser
(
"
~/.vim
"
)).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
#Die Plugins werden installiert
os
.
system
(
"
vim +slient +PlugInstall +qall
"
)
os
.
system
(
"
wget -O ~/temp/filetype.vim
"
+
gitRepo
+
"
/-/raw/master/filetype.vim
"
)
if
(
os
.
path
.
exists
(
path
.
expanduser
(
"
~/.vim/filetype.vim
"
))):
newData
=
Path
(
path
.
expanduser
(
"
~/temp/filetype.vim
"
)).
read_text
()
oldData
=
Path
(
path
.
expanduser
(
"
~/.vim/filetype.vim
"
)).
read_text
()
if
(
newData
not
in
oldData
):
Path
(
path
.
expanduser
(
"
~/.vim/filetype.vim
"
)).
write_text
(
oldData
+
newData
)
else
:
os
.
system
(
"
mv ~/temp/filetype.vim ~/.vim/filetype.vim
"
)
os
.
system
(
"
rm ~/temp -r
"
)
\ No newline at end of file
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