diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c43fbd32a..70cdfba9dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](https://keepachangelog.com/en/1.0.0/) specification. ## [Unreleased] + +### Added * [#1609](https://github.com/Shopify/shopify-cli/pull/1609): Add `--bind=HOST` option to `shopify theme serve`. +### Fixed +* [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Fix migrator's incompatibility with Ruby 2.5. +### Changed +* [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Change the `@shopify/scripts-checkout-apis-temp` package name to `@shopify/scripts-discount-apis`. ## Version 2.6.5 ### Fixed * [#1661](https://github.com/Shopify/shopify-cli/pull/1661): Handle npm list non-zero exit status when pushing scripts diff --git a/lib/project_types/script/config/extension_points.yml b/lib/project_types/script/config/extension_points.yml index 0fbb030b28..96e1a634f8 100644 --- a/lib/project_types/script/config/extension_points.yml +++ b/lib/project_types/script/config/extension_points.yml @@ -50,5 +50,5 @@ discount_types: libraries: typescript: beta: true - package: "@shopify/scripts-checkout-apis-temp" + package: "@shopify/scripts-discount-apis" repo: "https://github.com/Shopify/scripts-apis-examples" diff --git a/lib/shopify_cli/migrator.rb b/lib/shopify_cli/migrator.rb index 33698bf1c2..14fea1a436 100644 --- a/lib/shopify_cli/migrator.rb +++ b/lib/shopify_cli/migrator.rb @@ -9,23 +9,21 @@ def self.migrate( migrations_directory: File.expand_path("migrator/migrations", __dir__) ) baseline_date = last_migration_date - unless baseline_date.nil? - migrations = migrations(migrations_directory: migrations_directory) - .select { |m| - m.date > baseline_date.to_i - } - .each { |m| m.run } + unless baseline_date.nil? + migrations(migrations_directory: migrations_directory) + .select do |m| + m.date > baseline_date.to_i + end + .each(&:run) end store_last_migration_date end - private - def self.store_last_migration_date ShopifyCLI::DB.set(ShopifyCLI::Constants::StoreKeys::LAST_MIGRATION_DATE => Time.now.to_i) end - + def self.last_migration_date ShopifyCLI::DB.get(ShopifyCLI::Constants::StoreKeys::LAST_MIGRATION_DATE) end @@ -35,7 +33,7 @@ def self.migrations(migrations_directory:) file_name = File.basename(file_path).gsub(".rb", "") file_name_components = file_name.split("_") date_timestamp = file_name_components[0].to_i - migration_name = file_name_components[1...].join("_") + migration_name = file_name_components.drop(1).join("_") Migrator::Migration.new( name: migration_name, @@ -45,4 +43,4 @@ def self.migrations(migrations_directory:) end end end -end \ No newline at end of file +end