Author Topic: Cloning only the ulx and ulib folders from GitHub?  (Read 1915 times)

0 Members and 1 Guest are viewing this topic.

Offline Hyperion

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
Cloning only the ulx and ulib folders from GitHub?
« on: May 13, 2015, 05:00:41 AM »
Is it possible to clone only some folders from the Ulysses GitHub, such as ULX and Ulib? Directly into my addons folder? When I clone the repository, it creates a new folder in my addons called Ulysses, which I must then extract the mentioned folders from, because GMod won't be able to load them from that folder.

I am using the GitHub application to download and update all addons
« Last Edit: May 13, 2015, 05:04:28 AM by Hyperion »

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Cloning only the ulx and ulib folders from GitHub?
« Reply #1 on: May 13, 2015, 08:33:47 AM »
Unfortunately not- Git repositories must be cloned in full. That is one downside to how our git repository is set up. You could clone in a directory outside of Garrysmod, then use symbolic links/junction folders to reference the individual addons you want.

Alternately, Github provides SVN compatibility, so you could choose to check out the individual folders you want via SVN instead.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Hyperion

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
Re: Cloning only the ulx and ulib folders from GitHub?
« Reply #2 on: May 13, 2015, 08:53:14 AM »
The symbolic link idea sounds interesting, I never thought of it before. Since I'll be already fiddling with it so much, is there at least any way to automatically check for updates on all my cloned repos?

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Cloning only the ulx and ulib folders from GitHub?
« Reply #3 on: May 14, 2015, 08:47:10 AM »
You'd probably want to have a script that does a 'git pull' inside each cloned repo directory. I'm assuming you're on windows- here's a pretty basic batch script you could use:

(Note the path to git bin folder on line 2. You won't need that line if git is already in your PATH. You can open up a command prompt and type in 'git', and see if it recognizes it.)
Code: [Select]
ECHO OFF
set PATH=%PATH%;"C:\Program Files (x86)\Git\bin"
cd D:\SteamCMD\garrysmod\garrysmod\addons\

cd Ulysses
   git pull
cd ..
cd cooladdonyeah
   git pull
cd ..

pause

Obviously, you'll have to copy that 'cd dir, git pull, cd ..' loop for each directory.


After that, you can setup your script to run every so often by using Windows's task scheduluer:
http://www.thewindowsclub.com/how-to-schedule-batch-file-run-automatically-windows-7



Also (again, assuming windows), here's a demo on how to create a junction folder- These come in handy quite a bit.

Say you had your git repos in C:\git\ (C:\git\Ulysses for this example), and your server's addon folder is C:\SteamCMD\garrysmod\garrysmod\addons\.
In order to create a link to just ULX and ULib into your addons folder, you would open CMD as an administrator, then run the following commands:
Code: [Select]
mklink /D /J C:\SteamCMD\garrysmod\garrysmod\addons\ulx C:\git\Ulysses\ulx
mklink /D /J C:\SteamCMD\garrysmod\garrysmod\addons\ulib C:\git\Ulysses\ulib
The syntax is mklink /D /J <name of link> <target (existing) folder>.

Hope that helps!
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6