PureBasic Forum
https://www.purebasic.fr/english/

Register extensions and make menu-entry for PB
https://www.purebasic.fr/english/viewtopic.php?f=15&t=59400
Page 2 of 2

Author:  ts-soft [ Sun May 28, 2017 8:01 pm ]
Post subject:  Re: Register extensions and make menu-entry for PB

fryquez wrote:
If I run the Purebasic 5.60 included register.sh on my Ubuntu Mate 17.04,
I get an error: register.sh: 36: [: unexpected operator

I think, you have used anotherone :wink:
Change:
Code:
echo "[Desktop Entry]

to
Code:
echo "[Desktop Entry]"

Author:  fryquez [ Sun May 28, 2017 8:40 pm ]
Post subject:  Re: Register extensions and make menu-entry for PB

Hi ts-soft,

no the included one in Purebaisc 5.60 is following one:
Code:
#!/bin/bash

# Goto home
cd $HOME
# Make sure, dir exist
mkdir -p .local/share/mime/packages
# change to dir for purebasic.xml
cd .local/share/mime/packages
# purebasic.xml create
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > purebasic.xml
echo "<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>" >> purebasic.xml
echo "   <mime-type type=\"text/purebasic\">" >> purebasic.xml
echo "      <comment>PureBasic source code</comment>" >> purebasic.xml
echo "      <glob pattern=\"*.pb\"/>" >> purebasic.xml
echo "      <glob pattern=\"*.pbi\"/>" >> purebasic.xml
echo "      <glob pattern=\"*.pbf\"/>" >> purebasic.xml
echo "   </mime-type>" >> purebasic.xml
echo "</mime-info>" >> purebasic.xml

# change to home
cd $HOME
# Make sure, dir exist
mkdir -p .local/share/applications
# change to dir for PureBasic.desktop
cd .local/share/applications
# PureBasic.desktop create
echo "[Desktop Entry]" > PureBasic.desktop
echo "Comment=PureBasic IDE" >> PureBasic.desktop
echo "Terminal=false" >> PureBasic.desktop
echo "Name=PureBasic" >> PureBasic.desktop
echo "Type=Application" >> PureBasic.desktop
echo "MimeType=text/purebasic" >> PureBasic.desktop
echo "Categories=Development;" >> PureBasic.desktop
echo "StartupNotify=true" >> PureBasic.desktop
# check environment var
if [ "$PUREBASIC_HOME" == "" ]
then
   echo "Exec=${HOME}/purebasic/compilers/purebasic" >> PureBasic.desktop
   echo "Icon=${HOME}/purebasic/logo.png" >> PureBasic.desktop
else
   echo "Exec=${PUREBASIC_HOME}/compilers/purebasic" >> PureBasic.desktop
   echo "Icon=${PUREBASIC_HOME}/logo.png" >> PureBasic.desktop
fi

# Update Databases
update-desktop-database ~/.local/share/applications
update-mime-database    ~/.local/share/mime
echo "File extensions .pb, .pbi, .pbf are now registered for PureBasic."


so line 36 is: "if [ "$PUREBASIC_HOME" == "" ]"
Not sure why it complains about the bracket, removing it doesn't help either.

Author:  loulou2522 [ Mon Apr 02, 2018 12:57 pm ]
Post subject:  Re: Register extensions and make menu-entry for PB

Same problem on UBUNTU 17.10 and the sh file seems not executing
THe extension is not registered / Can someone help me to solve this problem

Page 2 of 2 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/