I have three separate files, and I would like to have a script that would install the below files in the local folder
Package Items
https://gitlab.com/darkout/builder/-/raw/master/_data/do-hero-content.yml
https://gitlab.com/darkout/builder/-/raw/master/_includes/do-hero-content.html
https://gitlab.com/darkout/builder/-/raw/master/_sass/modules/do-hero-content.scss
Sample code example
install do-hero
Should install the above three files in the local in the following folders
expected output: to have the files in the local below folder
local > /_data/do-hero-content.yml
local > /_includes/do-hero-content.html
local > /_sass/modules/do-hero-content.scss
Could someone advise me what the best way to execute this is?
Thanks
Shovan
You can write a ruby script called install that downloads these files (Calling curl or HTTPX), then use FileUtils to copy them to the location you wanted:
#!/usr/bin/env ruby
if ARGV[0] == 'do-hero'
# Write code to download these 3 files and copy to folders you want
end
Related
I need to create a run script that will un-zip a file a in the project source code directory and replace the existing files.
My requirement in details is like this. I have aa.framework and bb.bundle in a zip file. Zip file is in the source code directory. Now, at the run time (Each time compile the app) I want to up-zip the zip file and replace existing aa.framework file bb.bundle file with the un-zipped files.
Please help me to write a run script to do this if this is doable.
You can get the path to to your project from the environment variable PROJECT_DIR. So you just call the zip and unzip commands.
unzip "${PROJECT_DIR}/yourzip.zip"
How can I add a path to my current path in Julia, so that I can organize files and modules in folders, but still access them?
Note: the following paths may be Unix-specific.
You can add the file .juliarc.jl to your home directory, and include the line
#everywhere push!(LOAD_PATH,"/path/to/my/code")
The #everywhere ensures that it will work even if you've started julia with multiple workers.
This is an updated and extended version of the answer by tholy and ederag. On Linux and Windows with Julia 1.0 one can add the folder myproject/src in the user homefolder to the Julia LOAD_PATH by adding
using Distributed
#everywhere push!(LOAD_PATH, joinpath(homedir(), "myproject", "src"))
to <homedir>/julia/config/startup.jl. For a fresh Julia install, startup.jl nor the folder config exists (on Linux at least). Just create the file and folder and Julia will read startup.jl automatically.
Hi I am using git version 2.1.0 in my rails application . I want to ignore shell script from a folder called services
/services/*.sh
I have used this code in .gitignore , but it doesn’t works.I have called a single file directly too like
/services/setup_env_local.sh
its also not works .But other extensions like .log , .rb are ignoring with the same code
/services/*.log
what is the mistake I have done?...
Create a file in the root of the git directory called .gitignore and add the line /services/*.sh to it. This should work.
When I run bundle exec rspec spec/ I get the following messages in the console:
Could not open library 'libgtkmm-2.4': libgtkmm-2.4: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so': libgtkmm-2.4.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-2.4.so.1': libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0': libgtkmm-3.0: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so': libgtkmm-3.0.so: cannot open shared object file: No such file or directory.
Could not open library 'libgtkmm-3.0.so.1': libgtkmm-3.0.so.1: cannot open shared object file: No such file or directory
But, all of the tests pass and my app works just fine. Can anyone fill me in on what may have happened? Should I just scrap this box and clone my repo into a fresh one? I'm using Ruby 2.0.0p247 and Rails 4.0.2 in a Nitrous.io box. Thanks.
Even though unrelated (thank google for finding this), I have been trying to install Nitrogen for Ubuntu today. I get the same error. Seems like a specific GTK library has gone missing recently from either your system or your distro's repository (if you're even using Linux).
If you're using a Linux system, install the libgtkmm packages and if you're lucky enough, your missing library will be in one of those.
Use in Ubuntu this to install all of them:
sudo apt-get install libgtkmm*
Hope this helps.
In NodeJS/NPM, you can create a package.json and run npm install to install all your dependencies in a folder within your project: ./node_modules. (A project can be an app or another module/package.)
Ruby also has a "bundler" system (using a .bundle file) that keeps track of gems specific to a dir (ie project).
Does LuaRocks have similar conventions? Or is it recommeneded to install everything to /usr or $HOME?
So far I've been able to get similiar functionality, but I have to create a custom LuaRocks config file and specify --tree=my_local_lua_rocks_dir every time I want to install a rock. Granted, I can always create a bash script. The point is that it seems I'm going against a convention.
It is possible to install rocks into a directory under the current directory, using the --tree flag:
luarocks install --tree ./lua_modules lpeg
And then you have to configure your package.path and package.cpath variables in Lua (settable via LUA_PATH and LUA_CPATH environment variables) so it finds the modules installed inside it. There are several ways to do this conveniently: this tutorial explains how to do it, with more examples.
Instead of using Vert, I've decided to just edit the LuaRocks config file:
In /etc/luarocks/config.lua :
rocks_servers = {
[[http://rocks.moonscript.org/]],
[[http://luarocks.org/repositories/rocks]]
}
rocks_trees = {
[[/usr/local]],
[[./my_dir]]
}
./my_dir is relative to the pwd you're in, not to the location of the config file. Of course, change my_dir to whatever you want.
"The order of the rock_trees matters: When installing rocks, LuaRocks tries to pick a location to store the rock starting from the bottom of the list; when loading rocks in runtime, LuaRocks scans from the top of the list." From: http://luarocks.org/en/Config_file_format
Then in your .bashrc:
eval `luarocks path`
export PATH=$PATH:my_dir/bin
However, for certain commands you now have to specify the tree or it will give you a confusing error:
luarocks make --tree=my_dir