mirror of
				https://github.com/cheat/cheat.git
				synced 2025-11-04 07:45:28 +01:00 
			
		
		
		
	feat(installer): implement "installer"
Squashed commit of the following: commit5c322e79b7Author: Chris Lane <chris@chris-allen-lane.com> Date: Fri Mar 6 19:56:56 2020 -0500 docs(README): update the `README` Update the `README` to document the improved config-generation mechanism. commit803e1f014cAuthor: Chris Lane <chris@chris-allen-lane.com> Date: Fri Mar 6 19:19:49 2020 -0500 feat(config-init): platform-specific pathing Update `--init` subcommand to rely upon the same platform-detection intelligence that was previously implemented by the "installer". The installer and `--init` should now produce identical config files. commit99c48097e2Author: Chris Lane <chris@chris-allen-lane.com> Date: Fri Mar 6 18:26:33 2020 -0500 feat(installer): platform-correct config templating Modify the "installer" to populate cheatpaths with sensible defaults based on the detection of the user's operating system and environment. commit8e1580ff5aAuthor: Chris Lane <chris@chris-allen-lane.com> Date: Thu Mar 5 20:19:58 2020 -0500 fix(tests): fix `config.Paths` tests Refactor `config.Paths` (by externalizing a call to `homedir.Dir`) to decouple it from filesystem paths, thus facilitating cleaner unit-tests. commita08dca70d9Author: Chris Lane <chris@chris-allen-lane.com> Date: Thu Mar 5 18:14:27 2020 -0500 feat(installer): default path selection Modify the installer to improve default config and cheatsheet path selection. commite15bc6c966Author: Chris Lane <chris@chris-allen-lane.com> Date: Thu Mar 5 17:49:50 2020 -0500 fix(typo): correct comment typo in `main.go` commitefd09575dfAuthor: Chris Lane <chris@chris-allen-lane.com> Date: Thu Mar 5 17:46:49 2020 -0500 feat(config): refactor config path detection Previously, failing other checks, on Unix and BSD systems, `config.Paths` would attempt to compute the user's home directory by reading the `HOME` environment variable. This change deprecates that approach with a call to `homedir.Dir`, which is used elsewhere throughout the application. commitec10244ebeAuthor: Chris Lane <chris@chris-allen-lane.com> Date: Thu Mar 5 17:15:28 2020 -0500 chore(installer): delete unused file Delete `installer/installer.go`, which (in hindsight) was unnecessary. commitebd9ec6287Author: Chris Lane <chris@chris-allen-lane.com> Date: Wed Mar 4 19:31:13 2020 -0500 wip(installer): stub experimental "installer" Stubs out an experimental "installer" that will help new users to quickly configure `cheat`. commitecac5a0971Author: Chris Lane <chris@chris-allen-lane.com> Date: Wed Mar 4 19:30:12 2020 -0500 chore(dependencies): updates vendored dependencies
This commit is contained in:
		@@ -32,33 +32,34 @@ cheatpaths:
 | 
			
		||||
  # thus be overridden by more local cheatsheets. That being the case, you
 | 
			
		||||
  # should probably list community cheatsheets first.
 | 
			
		||||
  #
 | 
			
		||||
  # Note that the paths and tags listed below are just examples. You may freely
 | 
			
		||||
  # Note that the paths and tags listed below are placeholders. You may freely
 | 
			
		||||
  # change them to suit your needs.
 | 
			
		||||
  #
 | 
			
		||||
  # TODO: regarding community cheatsheets: these must be installed separately.
 | 
			
		||||
  # You may download them here:
 | 
			
		||||
  # Community cheatsheets must be installed separately, though you may have
 | 
			
		||||
  # downloaded them automatically when installing 'cheat'. If not, you may
 | 
			
		||||
  # download them here:
 | 
			
		||||
  #
 | 
			
		||||
  # https://github.com/cheat/cheatsheets
 | 
			
		||||
  #
 | 
			
		||||
  # Once downloaded, ensure that 'path' below points to the location at which
 | 
			
		||||
  # you downloaded the community cheatsheets.
 | 
			
		||||
  - name: community
 | 
			
		||||
    path: ~/cheat/cheatsheets/community
 | 
			
		||||
    path: COMMUNITY_PATH
 | 
			
		||||
    tags: [ community ]
 | 
			
		||||
    readonly: true
 | 
			
		||||
 | 
			
		||||
  # If you have personalized cheatsheets, list them last. They will take
 | 
			
		||||
  # precedence over the more global cheatsheets.
 | 
			
		||||
  - name: personal
 | 
			
		||||
    path: ~/cheat/cheatsheets/personal
 | 
			
		||||
    path: PERSONAL_PATH
 | 
			
		||||
    tags: [ personal ]
 | 
			
		||||
    readonly: false
 | 
			
		||||
 | 
			
		||||
  # While it requires no specific configuration here, it's also worth noting
 | 
			
		||||
  # that 'cheat' will automatically append directories named '.cheat' within
 | 
			
		||||
  # the current working directory to the 'cheatpath'. This can be very useful
 | 
			
		||||
  # if you'd like to closely associate cheatsheets with, for example, a
 | 
			
		||||
  # directory containing source code.
 | 
			
		||||
  # While it requires no configuration here, it's also worth noting that
 | 
			
		||||
  # 'cheat' will automatically append directories named '.cheat' within the
 | 
			
		||||
  # current working directory to the 'cheatpath'. This can be very useful if
 | 
			
		||||
  # you'd like to closely associate cheatsheets with, for example, a directory
 | 
			
		||||
  # containing source code.
 | 
			
		||||
  #
 | 
			
		||||
  # Such "directory-scoped" cheatsheets will be treated as the most "local"
 | 
			
		||||
  # cheatsheets, and will override less "local" cheatsheets. Likewise,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user