Home Reference Source Test

Function

Static Public Summary
public

Removes a file if it exists.

public

createFile(originalPath: string, linkPath: string)

public

createLinks(paths: string[])

Creates symbolic links.

public
public

Gets files in a directory.

public

link(cmd: Command, config: Object)

Creates symbolic links for designated files and directories.

public

release(cmd: Object, config: Object)

Bundles source files for release.

public

relink(cmd: Object, config: Object)

Destroys symbolic links for designated files and directories.

public
public

Empties a directory.

public

resolvePaths(path: string): {originalPath: string, linkPath: string}

Resolves file against current working directory and MyBB root.

public

unlink(cmd: Object, config: Object)

Destroys symbolic links for designated files and directories.

Static Public

public checkForFile(path: string) source

import {checkForFile} from 'shinka-cli/src/Linker/__tests__/helpers.js'

Removes a file if it exists.

Params:

NameTypeAttributeDescription
path string

Path to file

Throw:

Error

If file exists and could not be removed

public createFile(originalPath: string, linkPath: string) source

Params:

NameTypeAttributeDescription
originalPath string

Path to target file

linkPath string

Path to output file

Throw:

Error

If file could not be created

import {createLinks} from 'shinka-cli/src/Linker/__tests__/helpers.js'

Creates symbolic links.

Params:

NameTypeAttributeDescription
paths string[]

Relative paths of files

public fileExists(path: string): boolean source

Params:

NameTypeAttributeDescription
path string

Path to file

Return:

boolean

Gets files in a directory.

Params:

NameTypeAttributeDescription
dir string

Path to directory

Return:

string[]

List of filenames

import {link} from 'shinka-cli/src/commands/link.js'

Creates symbolic links for designated files and directories.

Params:

NameTypeAttributeDescription
cmd Command

To access command arguments

config Object

shinka.json

public release(cmd: Object, config: Object) source

import {release} from 'shinka-cli/src/commands/release.js'

Bundles source files for release.

Params:

NameTypeAttributeDescription
cmd Object

To access command arguments

config Object

shinka.json

import {relink} from 'shinka-cli/src/commands/relink.js'

Destroys symbolic links for designated files and directories.

Params:

NameTypeAttributeDescription
cmd Object

To access command arguments

config Object

shinka.json

public removeFile(path: string): boolean source

Params:

NameTypeAttributeDescription
path string

Path to file

Return:

boolean

Whether file was successfully removed

import {removeLinks} from 'shinka-cli/src/Linker/__tests__/helpers.js'

Empties a directory.

Params:

NameTypeAttributeDescription
dir string
  • optional
  • default: mybb_root

Path to directory

public resolvePaths(path: string): {originalPath: string, linkPath: string} source

import {resolvePaths} from 'shinka-cli/src/Linker/__tests__/helpers.js'

Resolves file against current working directory and MyBB root.

Params:

NameTypeAttributeDescription
path string
  • optional
  • default: ""

Path to file

Return:

{originalPath: string, linkPath: string}
import {unlink} from 'shinka-cli/src/commands/unlink.js'

Destroys symbolic links for designated files and directories.

Params:

NameTypeAttributeDescription
cmd Object

To access command arguments

config Object

shinka.json