-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better installation script and error handling
- Loading branch information
Showing
4 changed files
with
125 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,3 @@ The preview be displayed in the side panel or in the bottom panel | |
- English | ||
- French | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,51 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d "$HOME/.local/share/glib-2.0" ]; then | ||
mkdir ~/.local/share/glib-2.0 | ||
fi | ||
if [ ! -d "$HOME/.local/share/glib-2.0/schemas" ]; then | ||
mkdir ~/.local/share/glib-2.0/schemas | ||
fi | ||
if (( $EUID == 0 )); then | ||
|
||
if [ ! -d "/usr/lib/x86_64-linux-gnu/gedit/plugins" ]; then | ||
mkdir /usr/lib/x86_64-linux-gnu/gedit/plugins | ||
fi | ||
|
||
echo "Installing setting schemas in /usr/share/glib-2.0/schemas" | ||
|
||
cp org.gnome.gedit.plugins.markdown_preview.gschema.xml /usr/share/glib-2.0/schemas | ||
glib-compile-schemas /usr/share/glib-2.0/schemas | ||
|
||
echo "Installing plugin files in /usr/lib/x86_64-linux-gnu/gedit/plugins/" | ||
|
||
cp markdown_preview.plugin /usr/lib/x86_64-linux-gnu/gedit/plugins/markdown_preview.plugin | ||
cp -r markdown_preview /usr/lib/x86_64-linux-gnu/gedit/plugins/ | ||
|
||
else | ||
|
||
cp org.gnome.gedit.plugins.markdown_preview.gschema.xml ~/.local/share/glib-2.0/schemas | ||
glib-compile-schemas ~/.local/share/glib-2.0/schemas | ||
echo "Checking if adequate folders exist..." | ||
|
||
if [ ! -d "$HOME/.local/share/glib-2.0" ]; then | ||
mkdir ~/.local/share/glib-2.0 | ||
fi | ||
if [ ! -d "$HOME/.local/share/glib-2.0/schemas" ]; then | ||
mkdir ~/.local/share/glib-2.0/schemas | ||
fi | ||
if [ ! -d "$HOME/.local/share/gedit" ]; then | ||
mkdir ~/.local/share/gedit | ||
fi | ||
if [ ! -d "$HOME/.local/share/gedit/plugins" ]; then | ||
mkdir ~/.local/share/gedit/plugins | ||
fi | ||
|
||
echo "Installing setting schemas in ~/.local/share/glib-2.0/schemas" | ||
|
||
cp org.gnome.gedit.plugins.markdown_preview.gschema.xml ~/.local/share/glib-2.0/schemas | ||
glib-compile-schemas ~/.local/share/glib-2.0/schemas | ||
|
||
echo "Installing plugin files in ~/.local/share/gedit/plugins/" | ||
|
||
cp markdown_preview.plugin ~/.local/share/gedit/plugins/markdown_preview.plugin | ||
cp -r markdown_preview ~/.local/share/gedit/plugins/ | ||
|
||
fi | ||
|
||
cp markdown_preview.plugin ~/.local/share/gedit/plugins/markdown_preview.plugin | ||
cp -r markdown_preview ~/.local/share/gedit/plugins/ | ||
echo "Done." | ||
|
||
#sudo cp markdown_preview.py /usr/lib/x86_64-linux-gnu/gedit/plugins/markdown_preview.py | ||
#sudo cp markdown_preview.plugin /usr/lib/x86_64-linux-gnu/gedit/plugins/markdown_preview.plugin | ||
exit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
if (( $EUID == 0 )); then | ||
|
||
echo "Removing setting schemas from /usr/share/glib-2.0/schemas" | ||
|
||
rm /usr/share/glib-2.0/schemas/org.gnome.gedit.plugins.markdown_preview.gschema.xml | ||
glib-compile-schemas /usr/share/glib-2.0/schemas | ||
|
||
echo "Removing plugin files from /usr/lib/x86_64-linux-gnu/gedit/plugins/" | ||
|
||
rm /usr/lib/x86_64-linux-gnu/gedit/plugins/markdown_preview.plugin | ||
rm -r /usr/lib/x86_64-linux-gnu/gedit/plugins/markdown_preview | ||
|
||
else | ||
|
||
echo "Removing setting schemas in ~/.local/share/glib-2.0/schemas" | ||
|
||
rm ~/.local/share/glib-2.0/schemas/org.gnome.gedit.plugins.markdown_preview.gschema.xml | ||
glib-compile-schemas ~/.local/share/glib-2.0/schemas | ||
|
||
echo "Removing plugin files in ~/.local/share/gedit/plugins/" | ||
|
||
rm ~/.local/share/gedit/plugins/markdown_preview.plugin | ||
rm -r ~/.local/share/gedit/plugins/markdown_preview | ||
|
||
fi | ||
|
||
echo "Done." | ||
|
||
exit |