How to use the gluegun/toolbox.patching function in gluegun

To help you get started, we’ve selected a few gluegun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphprotocol / graph-cli / src / migrations / mapping_api_version_0_0_2.js View on Github external
apply: async ({ manifestFile }) => {
    // Make sure we catch all variants; we could load the manifest
    // and replace the values in the data structures here; unfortunately
    // writing that back to the file messes with the formatting more than
    // we'd like; that's why for now, we use a simple patching approach
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: 0.0.2', 'g'),
      'apiVersion: 0.0.3',
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp("apiVersion: '0.0.2'", 'g'),
      "apiVersion: '0.0.3'",
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: "0.0.2"', 'g'),
      'apiVersion: "0.0.3"',
    )
  },
}
github graphprotocol / graph-cli / src / migrations / mapping_api_version_0_0_2.js View on Github external
apply: async ({ manifestFile }) => {
    // Make sure we catch all variants; we could load the manifest
    // and replace the values in the data structures here; unfortunately
    // writing that back to the file messes with the formatting more than
    // we'd like; that's why for now, we use a simple patching approach
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: 0.0.2', 'g'),
      'apiVersion: 0.0.3',
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp("apiVersion: '0.0.2'", 'g'),
      "apiVersion: '0.0.3'",
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: "0.0.2"', 'g'),
      'apiVersion: "0.0.3"',
    )
  },
}
github graphprotocol / graph-cli / src / migrations / mapping_api_version_0_0_1.js View on Github external
apply: async ({ manifestFile }) => {
    // Make sure we catch all variants; we could load the manifest
    // and replace the values in the data structures here; unfortunately
    // writing that back to the file messes with the formatting more than
    // we'd like; that's why for now, we use a simple patching approach
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: 0.0.1', 'g'),
      'apiVersion: 0.0.2',
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp("apiVersion: '0.0.1'", 'g'),
      "apiVersion: '0.0.2'",
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: "0.0.1"', 'g'),
      'apiVersion: "0.0.2"',
    )
  },
}
github graphprotocol / graph-cli / src / migrations / mapping_api_version_0_0_1.js View on Github external
apply: async ({ manifestFile }) => {
    // Make sure we catch all variants; we could load the manifest
    // and replace the values in the data structures here; unfortunately
    // writing that back to the file messes with the formatting more than
    // we'd like; that's why for now, we use a simple patching approach
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: 0.0.1', 'g'),
      'apiVersion: 0.0.2',
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp("apiVersion: '0.0.1'", 'g'),
      "apiVersion: '0.0.2'",
    )
    await toolbox.patching.replace(
      manifestFile,
      new RegExp('apiVersion: "0.0.1"', 'g'),
      'apiVersion: "0.0.2"',
    )
  },
}
github graphprotocol / graph-cli / src / migrations / spec_version_0_0_2.js View on Github external
apply: async ({ manifestFile }) => {
    await toolbox.patching.replace(
      manifestFile,
      'specVersion: 0.0.1',
      'specVersion: 0.0.2',
    )
    await toolbox.patching.replace(
      manifestFile,
      "specVersion: '0.0.1'",
      "specVersion: '0.0.2'",
    )
    await toolbox.patching.replace(
      manifestFile,
      'specVersion: "0.0.1"',
      'specVersion: "0.0.2"',
    )
  },
}
github graphprotocol / graph-cli / src / migrations / spec_version_0_0_2.js View on Github external
apply: async ({ manifestFile }) => {
    await toolbox.patching.replace(
      manifestFile,
      'specVersion: 0.0.1',
      'specVersion: 0.0.2',
    )
    await toolbox.patching.replace(
      manifestFile,
      "specVersion: '0.0.1'",
      "specVersion: '0.0.2'",
    )
    await toolbox.patching.replace(
      manifestFile,
      'specVersion: "0.0.1"',
      'specVersion: "0.0.2"',
    )
  },
}