Week 2 Class 4 Thu Jan 23 Posted: Jan 23
After Class
gh
default The GitHub command-line client, gh
, is very useful. However, the default repo for your GitHub Classroom clones is not your own repo, but the original that your repo was cloned from, the one I setup to generate yours. So if you do a:
it doesn't take you to your repo at GitHub, but to the repo UACPSC/cpsc-421-oop-spring-2025-srcfacts-OOPS25-srcFacts.
The easy fix is to reset your default. The command is:
It will ask you to pick what you want as your default. Pick your repo. Here is an example run:
If you want to truly automate the command and not have to pick, you can use the following:
Note that every time you clone your repository you will have to do this.
srcFacts on macOS
On macOS, the libarchive library, libarchive.dylib, is already installed. You just need the proper include files.
I added an (optional) pull request to the repos. If you accept this pull request in GitHub, and do a git pull
in your cloned repositories, it will add a preset for macOS that will correctly set up the include files for libarchive. This does not use the libarchive from brew, but the version already installed on your machine.
To use this, in your build directory, use cmake with the macos
preset:
We will have more presets as the semester goes on, for all platforms. So, be sure to start using this on macOS. To see what presets are available:
Also, if you do not see a pull request, then you may have created your repository (using the GitHub Classroom Invitation Link) after I added the pull request. In that case, you already have the preset. Try it and see (if on macOS).
Announcements
All project due dates are 11:59:59 pm.
Agenda
Build and run the Project 1 srcfacts program performing the following:
cmake
make
make run
make
Enter the following command:
To demonstrate this, you will record a terminal session using asciinema. It records the commands you enter and the output the command produces. asciinema
is already installed in the GitHub Codespaces image. You can also install asciinema on Linux/WSL/macOS.
asciinema
is relatively straightforward to use.
You can play, pause, skip, etc. You can also copy the commands as text. Note that the replay even includes your pauses and any delay as the command is run.
At the end of the terminal session, asciinema
will show a URL. Anybody can use this URL to view the session. This is what you will submit for the exercise to the link in the exercise title.
IMPORTANT The URL should not contain "connect" or be a local file. Test your URL in a browser verifying that it shows the session you recorded. An incorrect URL will receive a 0.
Exercise 12: Rainfall III
Continuing on using the workflow from Rainfall I
As before, you can follow along and see the commits that I make in class:
If you have any questions or issues, make sure to contact me.
Unless otherwise noted, exercises are due by 4:30 pm on Fri Jan 24