@@ -45,14 +45,13 @@ rescue NotImplementedError
4545end
4646
4747file 'dart-sass/sass' do
48- gem_install 'sass-embedded' , SassConfig . gem_version , SassConfig . gem_platform do |dir |
49- mv File . absolute_path ( 'ext/sass/dart-sass' , dir ) , 'dart-sass'
48+ gem_install 'sass-embedded' , SassConfig . gem_version , SassConfig . gem_platform do |installer |
49+ gh_attestation_verify ( installer . gem , 'sass-contrib/sass-embedded-host-ruby' )
50+ mv File . absolute_path ( 'ext/sass/dart-sass' , installer . gem_dir ) , 'dart-sass'
5051 end
5152rescue StandardError
5253 archive = fetch ( SassConfig . dart_sass )
53- if SassConfig . development? && system ( 'gh' , 'auth' , 'status' , '--hostname' , 'github.com' , %i[ out err ] => File ::NULL )
54- sh 'gh' , 'attestation' , 'verify' , archive , '--hostname' , 'github.com' , '--repo' , 'sass/dart-sass'
55- end
54+ gh_attestation_verify ( archive , 'sass/dart-sass' )
5655 unarchive archive
5756 rm archive
5857end
@@ -424,10 +423,16 @@ module FileUtils
424423 installer . install
425424 end
426425
427- yield installer . dir
426+ yield installer
428427 ensure
429428 rm_rf install_dir unless Rake ::FileUtilsExt . nowrite_flag
430429 end
430+
431+ def gh_attestation_verify ( path , repo )
432+ if SassConfig . development? && system ( 'gh' , 'auth' , 'status' , '--hostname' , 'github.com' , %i[ out err ] => File ::NULL )
433+ sh 'gh' , 'attestation' , 'verify' , path , '--hostname' , 'github.com' , '--repo' , repo
434+ end
435+ end
431436end
432437
433438# The {Platform} module.
0 commit comments