File: create_npmrc.py

package info (click to toggle)
nbformat 5.10.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,072 kB
  • sloc: python: 4,746; makefile: 167; javascript: 2
file content (21 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

# Standard library imports
from __future__ import annotations

from pathlib import Path


def create_npmrc():
    """
    Create NPM configuration file in user home directory to use authentication
    token from environment variables.
    """
    fpath = Path("~/.npmrc").expanduser()
    with fpath.open("w") as fh:
        fh.write("//registry.npmjs.org/:_authToken=${NPM_TOKEN}")


if __name__ == "__main__":
    create_npmrc()