Scripting API

Scripting API

PackageIgnore

Class in Abyss.Core, from Abyss.Core.

A game's packages/.gitignore, which the editor writes whole: each engine package as it was installed is left out of git, since settings/packages.json lists it and every build puts it back from the registry; one with a file changed is kept in git, as is every package that is not the engine's, which a registry may not have when the game is built elsewhere.

public static class PackageIgnore

Remarks

The game's own .gitignore is never touched: what a person adds goes there, and this file is written again as the game's packages change.

Methods

FileIn

public static string FileIn(string game)

The file in the game game.

Parameters

  • game

Ignorable

public static IReadOnlyList<string> Ignorable(string game)

The packages the game may leave out of git, by id, in order: each settings/packages.json lists as the engine's whose copy is as it was installed — every file it carries as its hashes say, none added or gone. A copy keeping no hashes is not known to be unchanged, and is kept. None where the list cannot be read.

Parameters

  • game

TextOf

public static string TextOf(IEnumerable<string> ignored)

What the file says, leaving out ignored and what a build writes inside a package.

Parameters

  • ignored

Write

public static bool Write(string game, IEnumerable<string> ignored)

Writes the file leaving out ignored, where it says anything else or is not there; whether it was written. Nothing is written for a game with no packages folder.

Parameters

  • game
  • ignored

Exceptions

  • IOException: The file could not be written.

Constants

FileName

public const string FileName = ".gitignore"

The file, in the game's packages folder.

PathName

public const string PathName = "packages/.gitignore"

What it is called in a game's folder: packages/.gitignore.