While trying to install and configure Zotero using a bash script, I'm encountering some difficulties in adding an .xpi addon using bash. The documentation says:
To install a plugin in Zotero, download its .xpi file to your
computer. Then, in Zotero, click “Tools → Add-Ons”, then drag the .xpi
for the plugin onto the Add-Ons window that opens.
My closest approach was simulating the "open with" option and chosing "Zotero". However, even when using "open with" manually, Zotero assumes the incoming file is a literature file instead of an addon file. So the implementation:
#!/bin/bash
zotero some.xpi
Analogous to option 1 of this answer, launches Zotero, yet it does not (prompt the user to) install the add-on.
I did not yet find an API or method to load the add-on automatically. Hence I would like to ask: How can I add an arbitrary .xpi add-on for Zotero from a bash script?
The instructions in the documentation did not work for me, so I found out another method:
One can
Download the Zotero standalone version
Get the add-on source code
Compile the add-on into a build directory that contains an install.rdf file
Copy this build directory into the /modules/ directory of the Zotero Standalone Build repository
Compile the Zotero Standalone Build repository into a build (exported to /staging/<your system architecture>/)
Add the instructions to include the new addon when Zotero loads, into the /staging/<your system architecture>/defaults/prefs.js file.
Start zotero using: ./zotero.
git clone --recursive https://github.com/zotero/zotero-standalone-build
...
npm run build
git clone git#github.com<your zotero extension>.git
# Switch out build file to add additional plugin
cp -r "src/build.sh" "src/submodules/zotero/zotero-standalone-build/build.sh"
..
npm build
...
staging/Zotero_linux-x86_64/zotero -purgecaches
I created a modified build.sh file for the zotero-standalone-build which adds the extensions to the prefs.js file with:
echo 'pref("extensions.something.unopkgPaths", "{}");' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.version", "");' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.installed", false);' >> "$APPDIR/defaults/preferences/prefs.js"
echo 'pref("extensions.something.skipInstallation", false);' >> "$APPDIR/defaults/preferences/prefs.js"
The build command specifics depend on the addon you want to include.
Related
I'm am using rmarkdown to generate a word output and need pandoc to do so. Unfortunately I do not have administrator access on my work computer so I can't run the installer or use the install.pandoc() option.
I have tried downloading both the .zip and .tar.gz files from the github site and tried to install them manually using the "install" tab in RStudio, but get the error:
Warning in install.packages :
cannot open compressed file 'pandoc-2.2.1-windows-x86/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
Here states "If you prefer not to use the msi installer, we also provide a zip file that contains pandoc’s binaries and documentation. Simply unzip this file and move the binaries to a directory of your choice."
maybe I don't know what they mean by "move the binaries to a directory of your choice." - When I unzip the files, I still cannot access the package.
Side note - I have defined .libpaths() to allow me to install other packages, but i cannot get pandoc to work.
Any suggestions on how to do this?
Pandoc is a terminal application and does not require R-Studio to install it unziping the .tar.gz file with
linux: tar -xzvf filename.tar.gz
for windows the binary is the program pandoc itself that is unzipped from the zip file
simply unzip the file and pandoc should already be installed in the unzipped folder
after unzipping you might want to move pandoc.exe (for windows) int the directory where the project is located so that it is recognized
So there are two steps in this process for me to get it to work.
1: Install Pandoc
First download the MSI from https://github.com/jgm/pandoc/releases/
If you have trouble installing the MSI by right clicking on it, try creating a batch file with the contents:
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"
Then drag and drop the MSI on to this batch file and it will install without asking for any admin privileges.
2:
You'll need to tell the script to find Pandoc if its not running in RStudio already:
if(Sys.getenv("RSTUDIO") != "1"){rmarkdown::find_pandoc(dir = Sys.getenv("pandoc_path"))}
For me Sys.getenv("pandoc_path") = C:/Users/[username]/AppData/Local/Pandoc
Our company is using swagger to document their API's, currently a couple of developers are using the online swagger editor on their PC's.
I want to move this piece of the design process into our standard development environment, which is in a walled garden without internet access.
How do I go about installing npm and the swagger editor in an offline environment?
There are options to use either RHEL or Windows machines, although Windows is preferable as developers have local admin rights
In short answer is https://swagger.io/docs/swagger-tools/#swagger-editor
git clone https://github.com/swagger-api/swagger-editor.git
cd swagger-editor
npm install
npm run build
npm start
And it will works in your Intranet OK.
npm is not required, you can download the compiled files from the Swagger Editor repository:
index.html
dist\*
and open index.html locally (from the file system) or put the files onto a web server in your network.
With one command with npm/npx:
npx swagger-editor-binary
Download the one of the source releases from swagger-editor's github page (click releases link on the page)
unzip the downloaded source release zip/tar file.
cd into the extracted source dir, type 'npm install' (or if you have some npm mirror module installed, such as cnpm, use 'cnpm install' instead)
Use a browser to open index.html file in the source dir. Or, follow official guide the 'Setup with http-server module from GitHub' section to serve from a local static web server.
PS. You don't need to build the source code unless you want to contribute as written in the 'Contribute' section of the official document.
I'm trying to enable Travis CI on my NativeScript project and have purchased a NativeScript UI Pro library (without support).
How can I enable the license on each build on the server?
When installing the package it is referenced to a local .tgz file. in package.json like this:
dependencies: {
"nativescript-telerik-ui-pro": "file:pathToTelerikUiProPackage.tgz"
}
How can I make this file available to Travis without adding it to source control?
Did you follow the Pro install instructions at http://docs.telerik.com/devtools/nativescript-ui/getting-started
I don't have Pro, but it sounds like you don't use NPM to install it - you manually extract the file you get from their website and then add it as a plugin.
If this doesn't help, consider posting a question on their dedicated forums.
Further research made it clear that I needed to co-locate the Nativescript UI Pro package to my source code.
Given I work on an open source project this was not a solution.
As a work around I placed the package in a private repository and added a before_install script to download the file to the working directory on Travis.
.travis.yml:
before_install:
- sh get-nativescript-ui-pro.sh
The script to download is as follows.
get-nativescript-ui-pro.sh:
#!/bin/bash
if [ "$PRIVATE_USER" = "" ];
then
echo "ERROR: Can't get nativescript-ui-pro package. User not set";
exit;
fi
curl --trace /dev/null -s -O -u $PRIVATE_USER {LINK TO RESOURCE}
Replace {LINK TO RESOURCE} with a complete link to the resource, i.e. the stored Nativescript UI Pro .tgz file. An environment variable named PRIVATE_USER holds the credentials to the repository account. This can be set in the Travis configuration panel for the specific repository.
Xcode 5 seems to have changed the way it stores the build application package (xxx.app) such that ditto no longer works. In the ../BuildProductsPath/Release/ directory, the app is actually a symlink to .../InstallationBuildProductsLocation/Applications/...
MyApp.app -> ~/Library/Developer/Xcode/DerivedData/MyApp-emwilkqhlayanxahjpexlpbbkato/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp
This breaks the ditto command I was using to create a zip file of the application to put on my Sparkle update server.
Anyone have an updated script for building the Sparkle XML and ZIP files? Or know what environment variable I need to use to locate my actual binary after the Archive phase?
Here's the relevant lines from the post-archive script:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
cd "$BUILT_PRODUCTS_DIR"
ditto -ck --keepParent "$PROJECT_NAME.app" "$ARCHIVE_FILENAME"
That's from the sample script on the Sparkle website.
Turns out that in Xcode5 you need to pull the app package from the archive directory, not the Built Products directory. This works:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
ditto -ck --keepParent "${ARCHIVE_PRODUCTS_PATH}/Applications/${PROJECT_NAME}.app" "$ARCHIVE_FILENAME"
I see a lot of bundles here I'd like to get my hands on
http://svn.textmate.org/trunk/Bundles/
The problem is I don't know how to install them. I've read the section 5 of manual dedicated to bundles, but there's no example how to install those from SVN.
I see the existing ones have the extension .tmbundle, but those on SVN are done differently.
Try installing the bundle "GetBundles". It will help you pick new bundles in a nice GUI. I've been using it myself and it's definitely better than manually installing bundles.
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd !$
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
osascript -e 'tell app "TextMate" to reload bundles'
Then, go to "Bundles" - "GetBundles" - "Get Bundles". (source)
Alternatively, you can just put your .tmbundles into ~/Library/Application Support/TextMate/Bundles, as you may have seen from the code above.
Download a bundle by going to its page, e.g. https://github.com/textmate/matlab.tmbundle and clicking the Download ZIP button.
Unzip it.
Change the name of the folder from
matlab.tmbundle-master
to
matlab.tmbundle
Now you can open it.
Or you can just download them and double click to install, as long as the extension reads tmbundle, that's how I do it.